diff options
-rw-r--r-- | composer.json | 6 | ||||
-rw-r--r-- | php-react-socket.198690e.patch | 34 | ||||
-rw-r--r-- | php-react-socket.spec | 59 |
3 files changed, 78 insertions, 21 deletions
diff --git a/composer.json b/composer.json index cad0aef..bffd7bb 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,11 @@ "require": { "php": ">=5.3.0", "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "react/dns": "^0.4.13", + "react/dns": "^1.0 || ^0.4.13", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/stream": "^1.0 || ^0.7.1", "react/promise": "^2.6.0 || ^1.2.1", - "react/promise-timer": "^1.4.0" + "react/promise-timer": "^1.4.0", + "react/stream": "^1.1" }, "require-dev": { "clue/block-react": "^1.2", diff --git a/php-react-socket.198690e.patch b/php-react-socket.198690e.patch new file mode 100644 index 0000000..b213982 --- /dev/null +++ b/php-react-socket.198690e.patch @@ -0,0 +1,34 @@ +From 198690e6b736d3501cf272fa9e4ed59f3ee08a34 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20L=C3=BCck?= <christian@clue.engineering> +Date: Sun, 17 Nov 2019 00:30:30 +0100 +Subject: [PATCH] Improve test suite to exclude TLS 1.3 tests on PHP 7.3 + +Explicit TLS 1.3 support will be available in PHP 7.4: +https://github.com/php/php-src/pull/3909 + +Older PHP versions implicitly support TLS 1.3 provided that the +underlying OpenSSL version supports TLS 1.3. However, for PHP 7.3 some +recent changes implicitly disable TLS 1.3, so we skip TLS 1.3 tests on +affected PHP versions: https://github.com/php/php-src/pull/3317 +--- + tests/FunctionalSecureServerTest.php | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tests/FunctionalSecureServerTest.php b/tests/FunctionalSecureServerTest.php +index 7e7b0cc..226c380 100644 +--- a/tests/FunctionalSecureServerTest.php ++++ b/tests/FunctionalSecureServerTest.php +@@ -50,8 +50,11 @@ public function testClientCanConnectToServer() + + public function testClientUsesTls13ByDefaultWhenSupportedByOpenSSL() + { +- if (PHP_VERSION_ID < 70000 || !$this->supportsTls13()) { +- $this->markTestSkipped('Test requires PHP 7+ for crypto meta data and OpenSSL 1.1.1+ for TLS 1.3'); ++ if (PHP_VERSION_ID < 70000 || (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 70400) || !$this->supportsTls13()) { ++ // @link https://github.com/php/php-src/pull/3909 explicitly adds TLS 1.3 on PHP 7.4 ++ // @link https://github.com/php/php-src/pull/3317 implicitly limits to TLS 1.2 on PHP 7.3 ++ // all older PHP versions support TLS 1.3 (provided OpenSSL supports it), but only PHP 7 allows checking the version ++ $this->markTestSkipped('Test requires PHP 7+ for crypto meta data (but excludes PHP 7.3 because it implicitly limits to TLS 1.2) and OpenSSL 1.1.1+ for TLS 1.3'); + } + + $loop = Factory::create(); diff --git a/php-react-socket.spec b/php-react-socket.spec index d1d3248..94f607f 100644 --- a/php-react-socket.spec +++ b/php-react-socket.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-socket # -# Copyright (c) 2017-2018 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner reactphp %global github_name socket -%global github_version 0.8.12 -%global github_commit 7f7e6c56ccda7418a1a264892a625f38a5bdee0c +%global github_version 1.3.0 +%global github_commit 10f0629ec83ea0fa22597f348623f554227e3ca0 %global composer_vendor react %global composer_project socket @@ -24,12 +24,11 @@ %global clue_block_react_min_ver 1.2 %global clue_block_react_max_ver 2.0 # "evenement/evenement": "^3.0 || ^2.0 || ^1.0" -# NOTE: Restricted to one major version -%global evenement_min_ver 2.0 -%global evenement_max_ver 3.0 -# "react/dns": "^0.4.13" +%global evenement_min_ver 1.0 +%global evenement_max_ver 4.0 +# "react/dns": "^1.0 || ^0.4.13" %global react_dns_min_ver 0.4.13 -%global react_dns_max_ver 1.0 +%global react_dns_max_ver 2.0 # "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" %global react_event_loop_min_ver 0.3.5 %global react_event_loop_max_ver 2.0 @@ -39,8 +38,8 @@ # "react/promise-timer": "^1.4.0" %global react_promise_timer_min_ver 1.4.0 %global react_promise_timer_max_ver 2.0 -# "react/stream": "^1.0 || ^0.7.1" -%global react_stream_min_ver 0.7.1 +# "react/stream": "^1.1" +%global react_stream_min_ver 1.1 %global react_stream_max_ver 2.0 # Build using "--without tests" to disable tests @@ -50,20 +49,24 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 3%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: Async, streaming plaintext TCP/IP and secure TLS socket server -Group: Development/Libraries License: MIT URL: https://reactphp.org/socket/ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# Improve test suite to exclude TLS 1.3 tests on PHP 7.3 +# https://github.com/reactphp/socket/commit/198690e6b736d3501cf272fa9e4ed59f3ee08a34 +# https://github.com/reactphp/socket/commit/198690e6b736d3501cf272fa9e4ed59f3ee08a34.patch +Patch0: %{name}.198690e.patch + BuildArch: noarch # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: phpunit6 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(clue/block-react) >= %{clue_block_react_min_ver} with php-composer(clue/block-react) < %{clue_block_react_max_ver}) BuildRequires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver}) @@ -88,10 +91,12 @@ BuildRequires: php-composer(react/promise-timer) < %{react_promise_timer_max_ve BuildRequires: php-composer(react/stream) < %{react_stream_max_ver} BuildRequires: php-composer(react/stream) >= %{react_stream_min_ver} %endif -## phpcompatinfo (computed from version 0.8.12) +## phpcompatinfo (computed from version 1.3.0) BuildRequires: php-filter BuildRequires: php-openssl BuildRequires: php-pcre +BuildRequires: php-reflection +BuildRequires: php-sockets BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(fedora/autoloader) @@ -120,12 +125,15 @@ Requires: php-composer(react/promise-timer) < %{react_promise_timer_max_ve Requires: php-composer(react/stream) < %{react_stream_max_ver} Requires: php-composer(react/stream) >= %{react_stream_min_ver} %endif -# phpcompatinfo (computed from version 0.8.12) +# phpcompatinfo (computed from version 1.3.0) Requires: php-filter +Requires: php-pcre +Requires: php-sockets Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) -# packages have been merged (not provided as class names are different) + +# Packages have been merged (not provided as class names are different) Obsoletes: php-react-socket-client < 0.5 # Composer @@ -143,6 +151,9 @@ Autoloader: %{phpdir}/React/Socket/autoload.php %prep %setup -qn %{github_name}-%{github_commit} +# Improve test suite to exclude TLS 1.3 tests on PHP 7.3 +%patch0 -p1 + %build : Create autoloader @@ -189,10 +200,18 @@ BOOTSTRAP : Skip test requiring network access rm -f tests/IntegrationTest.php +: Skip "Class "React\Dns\Resolver\Resolver" is declared "final" and cannot be mocked" warnings +: Why is PHPUnit 6 failing the test run for this even if convertWarningsToExceptions="false"? +rm -f tests/DnsConnectorTest.php +sed \ + -e 's/function testConnectorUsesGivenResolverInstance/function SKIP_testConnectorUsesGivenResolverInstance/' \ + -e 's/function testConnectorUsesResolvedHostnameIfDnsIsUsed/function SKIP_testConnectorUsesResolvedHostnameIfDnsIsUsed/' \ + -i tests/ConnectorTest.php + : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php70 php71 php72 php73; do +PHPUNIT=$(which phpunit6) +for PHP_EXEC in "" php71 php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -213,6 +232,10 @@ exit $RETURN_CODE %changelog +* Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 1.3.0-1 +- Update to 1.3.0 (RHBZ #1600308) +- Use PHPUnit 6 + * Tue Jul 3 2018 Remi Collet <remi@remirepo.net> - 0.8.12-3 - obsolete php-react-socket-client (merged) |