summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-04-23 15:50:10 +0200
committerRemi Collet <remi@remirepo.net>2018-04-23 15:50:10 +0200
commit0fdf340338aedabd5fb036c8f10fba5ddd2167a6 (patch)
tree68e086f47aaacbeb117c23656891041bb78581ac
parent894ded843470ac2f29b46f3c59c2df39a02b9c6d (diff)
v1.0.2 from Fedora
* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-2 - Fix el6 tests * Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-1 - Update to 1.0.2 (RHBZ #1528620) - Add range version dependencies for Fedora >= 27 || RHEL >= 8 - Add composer.json to repo - Remove tests' patch
-rw-r--r--composer.json39
-rw-r--r--php-symfony-psr-http-message-bridge-upstream-pull-31.patch137
-rw-r--r--php-symfony-psr-http-message-bridge.spec62
3 files changed, 81 insertions, 157 deletions
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..76513b1
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,39 @@
+{
+ "name": "symfony/psr-http-message-bridge",
+ "type": "symfony-bridge",
+ "description": "PSR HTTP message bridge",
+ "keywords": ["http", "psr-7", "http-message"],
+ "homepage": "http://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.3",
+ "psr/http-message": "~1.0",
+ "symfony/http-foundation": "~2.3|~3.0|~4.0"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "~3.2|4.0"
+ },
+ "suggest": {
+ "psr/http-message-implementation": "To use the HttpFoundation factory",
+ "zendframework/zend-diactoros": "To use the Zend Diactoros factory"
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ }
+}
diff --git a/php-symfony-psr-http-message-bridge-upstream-pull-31.patch b/php-symfony-psr-http-message-bridge-upstream-pull-31.patch
deleted file mode 100644
index 9d0ca3c..0000000
--- a/php-symfony-psr-http-message-bridge-upstream-pull-31.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From f5c46f0ff42ac4cd2557a48a14bdb85c6f48d65f Mon Sep 17 00:00:00 2001
-From: Christian Flothmann <christian.flothmann@sensiolabs.de>
-Date: Thu, 4 May 2017 21:07:18 +0200
-Subject: [PATCH] test suite compatibility with PHPUnit 6
-
----
- .travis.yml | 17 +++++++++--------
- Tests/Factory/DiactorosFactoryTest.php | 9 +++++++--
- Tests/Factory/HttpFoundationFactoryTest.php | 4 ++--
- composer.json | 2 +-
- 4 files changed, 19 insertions(+), 13 deletions(-)
-
-diff --git a/.travis.yml b/.travis.yml
-index 3008471..da2f48c 100644
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -5,6 +5,7 @@ sudo: false
- cache:
- directories:
- - $HOME/.composer/cache/files
-+ - $HOME/symfony-bridge/.phpunit
-
- matrix:
- include:
-@@ -13,9 +14,9 @@ matrix:
- - php: 5.5
- - php: 5.6
- - php: 5.3
-- env: deps=low
-+ env: COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" SYMFONY_DEPRECATIONS_HELPER=weak
- - php: 5.6
-- env: deps=high
-+ env: COMPOSER_OPTIONS="" SYMFONY_DEPRECATIONS_HELPER=weak
- - php: 7.0
- - php: hhvm
- allow_failures:
-@@ -25,7 +26,9 @@ matrix:
- env:
- global:
- - deps=no
-- - SYMFONY_DEPRECATIONS_HELPER=weak
-+ - SYMFONY_DEPRECATIONS_HELPER=strict
-+ - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
-+ - COMPOSER_OPTIONS="--prefer-stable"
-
- before_install:
- - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
-@@ -37,10 +40,8 @@ before_install:
-
- install:
- - if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update zendframework/zend-diactoros; fi;
-- - if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
-- - if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
-- - if [ "$deps" = "high" ]; then composer --prefer-source update; fi;
-- - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest --prefer-stable update; fi;
-+ - composer update --prefer-source $COMPOSER_OPTIONS
-+ - vendor/bin/simple-phpunit install
-
- script:
-- - phpunit
-+ - vendor/bin/simple-phpunit
-diff --git a/Tests/Factory/DiactorosFactoryTest.php b/Tests/Factory/DiactorosFactoryTest.php
-index ddf0806..fbc1ce8 100644
---- a/Tests/Factory/DiactorosFactoryTest.php
-+++ b/Tests/Factory/DiactorosFactoryTest.php
-@@ -11,6 +11,7 @@
-
- namespace Symfony\Bridge\PsrHttpMessage\Tests\Factory;
-
-+use PHPUnit\Framework\TestCase;
- use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
- use Symfony\Component\HttpFoundation\BinaryFileResponse;
- use Symfony\Component\HttpFoundation\Cookie;
-@@ -22,7 +23,7 @@
- /**
- * @author Kévin Dunglas <dunglas@gmail.com>
- */
--class DiactorosFactoryTest extends \PHPUnit_Framework_TestCase
-+class DiactorosFactoryTest extends TestCase
- {
- private $factory;
- private $tmpDir;
-@@ -143,7 +144,11 @@ public function testCreateResponse()
- $this->assertEquals('Response content.', $psrResponse->getBody()->__toString());
- $this->assertEquals(202, $psrResponse->getStatusCode());
- $this->assertEquals(array('2.8'), $psrResponse->getHeader('X-Symfony'));
-- $this->assertEquals(array('city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT; path=/; httponly'), $psrResponse->getHeader('Set-Cookie'));
-+
-+ $cookieHeader = $psrResponse->getHeader('Set-Cookie');
-+ $this->assertInternalType('array', $cookieHeader);
-+ $this->assertCount(1, $cookieHeader);
-+ $this->assertRegExp('{city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT;( max-age=\d+;)? path=/; httponly}', $cookieHeader[0]);
- }
-
- public function testCreateResponseFromStreamed()
-diff --git a/Tests/Factory/HttpFoundationFactoryTest.php b/Tests/Factory/HttpFoundationFactoryTest.php
-index 47ef4e3..8790a20 100644
---- a/Tests/Factory/HttpFoundationFactoryTest.php
-+++ b/Tests/Factory/HttpFoundationFactoryTest.php
-@@ -11,6 +11,7 @@
-
- namespace Symfony\Bridge\PsrHttpMessage\Tests\Factory;
-
-+use PHPUnit\Framework\TestCase;
- use Psr\Http\Message\UploadedFileInterface;
- use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
- use Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\Response;
-@@ -22,7 +23,7 @@
- /**
- * @author Kévin Dunglas <dunglas@gmail.com>
- */
--class HttpFoundationFactoryTest extends \PHPUnit_Framework_TestCase
-+class HttpFoundationFactoryTest extends TestCase
- {
- /** @var HttpFoundationFactory */
- private $factory;
-@@ -198,7 +199,6 @@ public function testCreateResponse()
- 'theme=light',
- 'test',
- 'ABC=AeD; Domain=dunglas.fr; Path=/kevin; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly',
--
- ),
- ),
- new Stream('The response body'),
-diff --git a/composer.json b/composer.json
-index ad25080..90412ac 100644
---- a/composer.json
-+++ b/composer.json
-@@ -21,7 +21,7 @@
- "symfony/http-foundation": "~2.3|~3.0"
- },
- "require-dev": {
-- "symfony/phpunit-bridge": "~2.7|~3.0"
-+ "symfony/phpunit-bridge": "~3.2"
- },
- "suggest": {
- "psr/http-message-implementation": "To use the HttpFoundation factory",
diff --git a/php-symfony-psr-http-message-bridge.spec b/php-symfony-psr-http-message-bridge.spec
index aed1ecc..d8ab02f 100644
--- a/php-symfony-psr-http-message-bridge.spec
+++ b/php-symfony-psr-http-message-bridge.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-symfony-psr-http-message-bridge
#
-# Copyright (c) 2015-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2015-2018 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner symfony
%global github_name psr-http-message-bridge
-%global github_version 1.0.0
-%global github_commit 66085f246d3893cbdbcec5f5ad15ac60546cf0de
+%global github_version 1.0.2
+%global github_commit c2b757934f2d9681a287e662efbc27c41fe8ef86
%global composer_vendor symfony
%global composer_project psr-http-message-bridge
@@ -23,10 +23,14 @@
# "psr/http-message": "~1.0"
%global psr_http_message_min_ver 1.0
%global psr_http_message_max_ver 2.0
-# "symfony/http-foundation": "~2.3|~3.0"
+# "symfony/http-foundation": "~2.3|~3.0|~4.0"
# NOTE: Min version not 2.3 because autoloader required
%global symfony_min_ver %{?el6:2.3.31}%{!?el6:2.7.1}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global symfony_max_ver 5.0
+%else
%global symfony_max_ver 4.0
+%endif
%global with_zend_diactoros 0%{!?el6:1}
@@ -37,7 +41,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 2%{?github_release}%{?dist}
Summary: Symfony PSR HTTP message bridge
Group: Development/Libraries
@@ -45,10 +49,6 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-# Fix test suite with !el6 and zendframework/zend-diactoros
-# https://github.com/symfony/psr-http-message-bridge/pull/31
-Patch0: %{name}-upstream-pull-31.patch
-
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -58,11 +58,15 @@ BuildRequires: php-composer(zendframework/zend-diactoros)
BuildRequires: php-composer(phpunit/phpunit)
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(psr/http-message) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver})
+BuildRequires: (php-composer(symfony/http-foundation) >= %{symfony_min_ver} with php-composer(symfony/http-foundation) < %{symfony_max_ver})
+%else
BuildRequires: php-composer(psr/http-message) < %{psr_http_message_max_ver}
BuildRequires: php-composer(psr/http-message) >= %{psr_http_message_min_ver}
BuildRequires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-BuildRequires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
-## phpcompatinfo (computed from version 1.0.0)
+%endif
+## phpcompatinfo (computed from version 1.0.2)
BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
@@ -72,11 +76,15 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(psr/http-message) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver})
+Requires: (php-composer(symfony/http-foundation) >= %{symfony_min_ver} with php-composer(symfony/http-foundation) < %{symfony_max_ver})
+%else
Requires: php-composer(psr/http-message) < %{psr_http_message_max_ver}
Requires: php-composer(psr/http-message) >= %{psr_http_message_min_ver}
Requires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-Requires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
-# phpcompatinfo (computed from version 1.0.0)
+%endif
+# phpcompatinfo (computed from version 1.0.2)
Requires: php-date
Requires: php-spl
# Autoloader
@@ -102,10 +110,6 @@ Autoloader: %{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
-%if 0%{!?el6:1}
-%patch0 -p1
-%endif
-
%build
: Create autoloader
@@ -122,6 +126,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Http/Message/autoload.php',
array(
+ '%{phpdir}/Symfony4/Component/HttpFoundation/autoload.php',
'%{phpdir}/Symfony3/Component/HttpFoundation/autoload.php',
'%{phpdir}/Symfony/Component/HttpFoundation/autoload.php',
),
@@ -145,13 +150,21 @@ cp -rp *.php Factory Tests %{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/
%check
%if %{with_tests}
+: Create tests bootstrap
+cat <<'BOOTSTRAP' | tee -a bootstrap.php
+<?php
+require_once '%{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php';
+if (!class_exists('PHPUnit\\Framework\\TestCase')) {
+ class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase');
+}
+BOOTSTRAP
+
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70} php71 php72; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --verbose \
- --bootstrap %{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php \
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
|| RETURN_CODE=1
fi
done
@@ -171,6 +184,15 @@ exit $RETURN_CODE
%changelog
+* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-2
+- Fix el6 tests
+
+* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-1
+- Update to 1.0.2 (RHBZ #1528620)
+- Add range version dependencies for Fedora >= 27 || RHEL >= 8
+- Add composer.json to repo
+- Remove tests' patch
+
* Thu Sep 21 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.0-3
- Allow Symfony 3
- Modify tests