From 3ec3fa0c18cb6a8f66f5e4a47db55b250b614cfb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 21 Nov 2018 15:30:16 +0100 Subject: v0.9.10 --- 798.patch | 96 -------------------------- b2f20b33942c2c84bc3b3b169098b448b3e66737.patch | 23 ------ php-deepend-Mockery.spec | 35 +++++++--- 3 files changed, 25 insertions(+), 129 deletions(-) delete mode 100644 798.patch delete mode 100644 b2f20b33942c2c84bc3b3b169098b448b3e66737.patch diff --git a/798.patch b/798.patch deleted file mode 100644 index c394c24..0000000 --- a/798.patch +++ /dev/null @@ -1,96 +0,0 @@ -From ebcef93d662613c48eb8f9b53470992a66aaca9c Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 6 Oct 2017 14:51:05 +0200 -Subject: [PATCH 1/2] fix for 7.2 - ---- - tests/Mockery/DemeterChainTest.php | 2 +- - tests/Mockery/ExpectationTest.php | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tests/Mockery/DemeterChainTest.php b/tests/Mockery/DemeterChainTest.php -index 9767f1ee..deed5eef 100644 ---- a/tests/Mockery/DemeterChainTest.php -+++ b/tests/Mockery/DemeterChainTest.php -@@ -28,7 +28,7 @@ class DemeterChainTest extends MockeryTestCase - - public function setUp() - { -- $this->mock = $this->mock = Mockery::mock('object')->shouldIgnoreMissing(); -+ $this->mock = $this->mock = Mockery::mock('stdClass')->shouldIgnoreMissing(); - } - - public function tearDown() -diff --git a/tests/Mockery/ExpectationTest.php b/tests/Mockery/ExpectationTest.php -index c3c31993..6d1ddf4d 100644 ---- a/tests/Mockery/ExpectationTest.php -+++ b/tests/Mockery/ExpectationTest.php -@@ -1238,7 +1238,7 @@ public function testNumericConstraintThrowsExceptionWhenConstraintUnmatched() - - public function testObjectConstraintMatchesArgument() - { -- $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once(); -+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once(); - $this->mock->foo(new stdClass); - $this->container->mockery_verify(); - } -@@ -1246,7 +1246,7 @@ public function testObjectConstraintMatchesArgument() - public function testObjectConstraintNonMatchingCase() - { - $this->mock->shouldReceive('foo')->times(3); -- $this->mock->shouldReceive('foo')->with(1, Mockery::type('object`'))->never(); -+ $this->mock->shouldReceive('foo')->with(1, Mockery::type('stdClass`'))->never(); - $this->mock->foo(); - $this->mock->foo(1); - $this->mock->foo(1, 2, 3); -@@ -1258,7 +1258,7 @@ public function testObjectConstraintNonMatchingCase() - */ - public function testObjectConstraintThrowsExceptionWhenConstraintUnmatched() - { -- $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once(); -+ $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once(); - $this->mock->foo('f'); - $this->container->mockery_verify(); - } - -From fe282c1ac52b127e4b8a66e9d46fb1edae1de8c7 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 6 Oct 2017 15:03:10 +0200 -Subject: [PATCH 2/2] change mocked class to avoid Mockery/DateTimeZone.php not - found - ---- - library/Mockery/Loader/EvalLoader.php | 1 - - tests/Mockery/NamedMockTest.php | 4 ++-- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/library/Mockery/Loader/EvalLoader.php b/library/Mockery/Loader/EvalLoader.php -index b9d172af..0fb62117 100644 ---- a/library/Mockery/Loader/EvalLoader.php -+++ b/library/Mockery/Loader/EvalLoader.php -@@ -12,7 +12,6 @@ public function load(MockDefinition $definition) - if (class_exists($definition->getClassName(), false)) { - return; - } -- - eval("?>" . $definition->getCode()); - } - } -diff --git a/tests/Mockery/NamedMockTest.php b/tests/Mockery/NamedMockTest.php -index 28920072..28dd2fdd 100644 ---- a/tests/Mockery/NamedMockTest.php -+++ b/tests/Mockery/NamedMockTest.php -@@ -33,11 +33,11 @@ public function itCreatesANamedMock() - /** @test */ - public function itCreatesPassesFurtherArgumentsJustLikeMock() - { -- $mock = Mockery::namedMock("Mockery\Dave456", "DateTime", array( -+ $mock = Mockery::namedMock("Mockery\Dave456", "DateTimeZone", array( - "getDave" => "dave" - )); - -- $this->assertInstanceOf("DateTime", $mock); -+ $this->assertInstanceOf("DateTimeZone", $mock); - $this->assertEquals("dave", $mock->getDave()); - } - diff --git a/b2f20b33942c2c84bc3b3b169098b448b3e66737.patch b/b2f20b33942c2c84bc3b3b169098b448b3e66737.patch deleted file mode 100644 index f1e4055..0000000 --- a/b2f20b33942c2c84bc3b3b169098b448b3e66737.patch +++ /dev/null @@ -1,23 +0,0 @@ -From b2f20b33942c2c84bc3b3b169098b448b3e66737 Mon Sep 17 00:00:00 2001 -From: Craig Duncan -Date: Fri, 7 Apr 2017 09:43:56 +0100 -Subject: [PATCH] Avoid warnings in PHP 7.2 from count() - ---- - library/Mockery/Expectation.php | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/library/Mockery/Expectation.php b/library/Mockery/Expectation.php -index bccf82ec..b215890c 100644 ---- a/library/Mockery/Expectation.php -+++ b/library/Mockery/Expectation.php -@@ -310,7 +310,8 @@ public function matchArgs(array $args) - if (empty($this->_expectedArgs) && !$this->_noArgsExpectation) { - return true; - } -- if (count($args) !== count($this->_expectedArgs)) { -+ $expected = is_array($this->_expectedArgs) ? count($this->_expectedArgs) : 0; -+ if (count($args) !== $expected) { - return false; - } - $argCount = count($args); diff --git a/php-deepend-Mockery.spec b/php-deepend-Mockery.spec index 818a9bd..f036c69 100644 --- a/php-deepend-Mockery.spec +++ b/php-deepend-Mockery.spec @@ -7,15 +7,15 @@ # # Please preserve changelog entries # -%global gh_commit 6fdb61243844dc924071d3404bb23994ea0b6856 +%global gh_commit 4876fc0c7d9e5da49712554a35c94d84ed1e9ee5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner padraic %global gh_project mockery %global with_tests 0%{!?_without_tests:1} Name: php-deepend-Mockery -Version: 0.9.9 -Release: 4%{?dist} +Version: 0.9.10 +Release: 1%{?dist} Summary: Mockery is a simple but flexible PHP mock object framework Group: Development/Libraries @@ -28,9 +28,6 @@ Source1: %{gh_project}-autoload.php # Use our autoloader Patch0: %{gh_project}-tests.patch -# Upstream patch for 7.2 -Patch1: https://github.com/mockery/mockery/commit/b2f20b33942c2c84bc3b3b169098b448b3e66737.patch -Patch2: https://patch-diff.githubusercontent.com/raw/mockery/mockery/pull/798.patch BuildArch: noarch %if %{with_tests} @@ -38,7 +35,12 @@ BuildArch: noarch # "phpunit/phpunit": "~4.0" BuildRequires: php-composer(phpunit/phpunit) >= 4.0 BuildRequires: php(language) >= 5.3.2 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 1.1 with php-composer(hamcrest/hamcrest-php) < 2) +%else +BuildRequires: php-composer(hamcrest/hamcrest-php) < 2 BuildRequires: php-composer(hamcrest/hamcrest-php) >= 1.1 +%endif # Autoloader BuildRequires: php-composer(fedora/autoloader) %endif @@ -48,8 +50,12 @@ BuildRequires: php-composer(fedora/autoloader) # "lib-pcre": ">=7.0", # "hamcrest/hamcrest-php": "~1.1" Requires: php(language) >= 5.3.2 -Requires: php-composer(hamcrest/hamcrest-php) >= 1.1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(hamcrest/hamcrest-php) >= 1.1 with php-composer(hamcrest/hamcrest-php) < 2) +%else Requires: php-composer(hamcrest/hamcrest-php) < 2 +Requires: php-composer(hamcrest/hamcrest-php) >= 1.1 +%endif # From phpcompatinfo report for version 0.9.7 Requires: php-pcre Requires: php-spl @@ -75,9 +81,11 @@ To use this library, you just have to add, in your project: %setup -q -n %{gh_project}-%{gh_commit} cp %{SOURCE1} library/Mockery/autoload.php + +mv library/helpers.php library/Mockery/ +sed -e 's:helpers.php:Mockery/helpers.php:' -i library/Mockery.php + %patch0 -p0 -b .rpm -%patch1 -p1 -%patch2 -p1 %build @@ -96,7 +104,7 @@ sed -e 's:@BUILD@:%{buildroot}/%{_datadir}/php:' -i tests/Bootstrap.php : Run upstream test suite ret=0 -for cmd in php php56 php70 php71 php72; do +for cmd in php php70 php71 php72 php73; do if which $cmd; then $cmd %{_bindir}/phpunit --verbose || ret=1 fi @@ -122,6 +130,13 @@ fi %changelog +* Wed Nov 21 2018 Remi Collet - 0.9.10-1 +- update to 0.9.10 + +* Mon Sep 10 2018 Remi Collet - 0.9.9-7 +- use range dependencies +- ensure hamcrest v1 is used, fix FTBFS + * Fri Oct 6 2017 Remi Collet - 0.9.9-4 - add patches for PHP 7.2 -- cgit