[php-guzzlehttp-streams] add upstream patch for test suite against latest PHP see https://github.com/guzzle/streams/issues/29
Remi Collet
remi at fedoraproject.org
Thu Jan 22 06:32:54 UTC 2015
commit 09f1eb1494ca27c672d255452a60c5a3c21ca8ed
Author: Remi Collet <remi at fedoraproject.org>
Date: Thu Jan 22 07:33:17 2015 +0100
add upstream patch for test suite against latest PHP see https://github.com/guzzle/streams/issues/29, thank Koschei
php-guzzlehttp-streams-tests.patch | 48 ++++++++++++++++++++++++++++++++++++
php-guzzlehttp-streams.spec | 16 ++++++++---
2 files changed, 59 insertions(+), 5 deletions(-)
---
diff --git a/php-guzzlehttp-streams-tests.patch b/php-guzzlehttp-streams-tests.patch
new file mode 100644
index 0000000..2a7554b
--- /dev/null
+++ b/php-guzzlehttp-streams-tests.patch
@@ -0,0 +1,48 @@
+From ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora at famillecollet.com>
+Date: Wed, 21 Jan 2015 13:45:19 +0100
+Subject: [PATCH] Fix #29 feof need a failed read
+
+---
+ tests/AppendStreamTest.php | 1 +
+ tests/FnStreamTest.php | 1 +
+ tests/GuzzleStreamWrapperTest.php | 1 +
+ tests/LimitStreamTest.php | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/tests/AppendStreamTest.php b/tests/AppendStreamTest.php
+index a1d302d..2a0adb6 100644
+--- a/tests/AppendStreamTest.php
++++ b/tests/AppendStreamTest.php
+@@ -109,6 +109,7 @@ public function testCanReadFromMultipleStreams()
+ $this->assertEquals('foo', $a->read(3));
+ $this->assertEquals('bar', $a->read(3));
+ $this->assertEquals('baz', $a->read(3));
++ $this->assertEmpty($a->read(1));
+ $this->assertTrue($a->eof());
+ $this->assertSame(9, $a->tell());
+ $this->assertEquals('foobarbaz', (string) $a);
+diff --git a/tests/GuzzleStreamWrapperTest.php b/tests/GuzzleStreamWrapperTest.php
+index 33c3ecc..f10cc78 100644
+--- a/tests/GuzzleStreamWrapperTest.php
++++ b/tests/GuzzleStreamWrapperTest.php
+@@ -19,6 +19,7 @@ public function testResource()
+ $this->assertSame(3, fwrite($handle, 'bar'));
+ $this->assertSame(0, fseek($handle, 0));
+ $this->assertSame('foobar', fread($handle, 6));
++ $this->assertEmpty(fread($handle, 1));
+ $this->assertTrue(feof($handle));
+
+ // This fails on HHVM for some reason
+diff --git a/tests/LimitStreamTest.php b/tests/LimitStreamTest.php
+index efb1dc5..6137e82 100644
+--- a/tests/LimitStreamTest.php
++++ b/tests/LimitStreamTest.php
+@@ -30,6 +30,7 @@ public function testReturnsSubset()
+ $body->seek(0);
+ $this->assertFalse($body->eof());
+ $this->assertEquals('oo', $body->read(100));
++ $this->assertEmpty($body->read(1));
+ $this->assertTrue($body->eof());
+ }
+
diff --git a/php-guzzlehttp-streams.spec b/php-guzzlehttp-streams.spec
index 4a40de3..04030f3 100644
--- a/php-guzzlehttp-streams.spec
+++ b/php-guzzlehttp-streams.spec
@@ -25,7 +25,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 2%{?github_release}%{?dist}
+Release: 3%{?github_release}%{?dist}
Summary: Provides a simple abstraction over streams of data
Group: Development/Libraries
@@ -33,6 +33,9 @@ License: MIT
URL: http://docs.guzzlephp.org/en/guzzle4/streams.html
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+# Upstream patch (adapted for 1.5.1)
+Patch0: %{name}-tests.patch
+
BuildArch: noarch
%if %{with_tests}
# For tests: composer.json
@@ -58,6 +61,8 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%prep
%setup -qn %{github_name}-%{github_commit}
+%patch0 -p1 -b .upstream
+
%build
# Empty build section, nothing required
@@ -83,10 +88,7 @@ spl_autoload_register(function ($class) {
});
AUTOLOAD
-# Create PHPUnit config w/ colors turned off
-sed 's/colors\s*=\s*"true"/colors="false"/' phpunit.xml.dist > phpunit.xml
-
-%{_bindir}/phpunit --include-path="%{buildroot}%{_datadir}/php" -d date.timezone="UTC"
+%{_bindir}/phpunit --include-path="%{buildroot}%{_datadir}/php"
%else
: Tests skipped
%endif
@@ -101,6 +103,10 @@ sed 's/colors\s*=\s*"true"/colors="false"/' phpunit.xml.dist > phpunit.xml
%changelog
+* Thu Jan 22 2015 Remi Collet <remi at fedoraproject.org> - 1.5.1-3
+- add upstream patch for test suite against latest PHP
+ see https://github.com/guzzle/streams/issues/29, thank Koschei
+
* Tue Aug 26 2014 Shawn Iwinski <shawn.iwinski at gmail.com> - 1.5.1-2
- Updated URL and description per upstream
- Fix test suite when previous version installed
More information about the scm-commits
mailing list