From 1d4c69a670b19c6bd5e0a7a2054b134ef59165cc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 23 Apr 2018 11:38:44 +0200 Subject: more tests --- event-upstream.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-event.spec | 2 ++ 2 files changed, 56 insertions(+) diff --git a/event-upstream.patch b/event-upstream.patch index cf3d8a8..396011c 100644 --- a/event-upstream.patch +++ b/event-upstream.patch @@ -51,3 +51,57 @@ index d5945df..e37b2b1 100644 -- 2.10.5 +From 0ea49e828fac05f17f258f525420ed807bd81716 Mon Sep 17 00:00:00 2001 +From: Ruslan Osmanov +Date: Mon, 23 Apr 2018 16:01:40 +0700 +Subject: [PATCH] Fixed build errors in PHP 5.4 + +--- + tests/12-serialization.phpt | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/tests/12-serialization.phpt b/tests/12-serialization.phpt +index e37b2b1..82125a5 100644 +--- a/tests/12-serialization.phpt ++++ b/tests/12-serialization.phpt +@@ -11,7 +11,6 @@ $eventHttpConnectionClass = EVENT_NS . '\\EventHttpConnection'; + $eventBaseClass = EVENT_NS . '\\EventBase'; + $eventHttpRequestClass = EVENT_NS . '\\EventHttpRequest'; + $eventSslContextClass = EVENT_NS . '\\EventSslContext'; +-$eventExceptionClass = EVENT_NS . '\\EventException'; + + $base = new $eventBaseClass(); + $listener = new $eventListenerClass($base, function () { }, null, 0, -1, '0.0.0.0:12345'); +@@ -38,17 +37,26 @@ echo "1 - ok\n"; + + ///////////////////////////////////////////// + +-foreach ([ $base, $http, $http_request, $http_connection, $config, $listener ] as $object) { ++function testSerializeEventObject($object) { ++ $eventExceptionClass = EVENT_NS . '\\EventException'; ++ + try { + serialize($object); + } catch (\Exception $e) { + echo get_class($object), ' - ', + ($e instanceof $eventExceptionClass ? 'ok' : 'error - ' . get_class($e)), + "\n"; +- } finally { +- $object = null; + } + } ++ ++testSerializeEventObject($base); ++testSerializeEventObject($http); ++testSerializeEventObject($http_request); ++testSerializeEventObject($http_connection); ++testSerializeEventObject($config); ++testSerializeEventObject($listener); ++ ++ + ?> + --EXPECTF-- + 1 - ok +-- +2.10.5 + diff --git a/php-pecl-event.spec b/php-pecl-event.spec index 6182e49..24e2cc3 100644 --- a/php-pecl-event.spec +++ b/php-pecl-event.spec @@ -46,6 +46,8 @@ Patch0: %{pecl_name}-upstream.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear +#BuildRequires: gdb +#BuildRequires: php-debuginfo BuildRequires: pkgconfig(libevent) >= 2 %global _event_prefix %{_root_prefix} -- cgit