From 1211fd01bf78fc62b40665d6e236322d9c9c0b89 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Mon, 6 Apr 2020 13:52:40 +0100 Subject: [PATCH] Update the method definition to match the one in updated phpunit --- Makefile | 4 ++-- composer.json | 5 +++-- phpunit.xml.dist | 2 +- .../Compiler/Discovery/PropertyDiscoveryTest.php | 6 ++++-- .../Compiler/ExposeServicesForTestsPassTest.php | 10 ++++++---- tests/TestListener/ServiceInjectorListenerTest.php | 3 +++ tests/TestListener/TestCaseContainerFactoryTest.php | 6 ++++-- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 4092ee1..58198a0 100644 --- a/Makefile +++ b/Makefile @@ -93,10 +93,10 @@ tools/deptrac: curl -Ls http://get.sensiolabs.de/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac tools/infection: tools/infection.pubkey - curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar -o tools/infection && chmod +x tools/infection + curl -Ls https://github.com/infection/infection/releases/download/0.16.1/infection.phar -o tools/infection && chmod +x tools/infection tools/infection.pubkey: - curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar.pubkey -o tools/infection.pubkey + curl -Ls https://github.com/infection/infection/releases/download/0.16.1/infection.phar.pubkey -o tools/infection.pubkey tools/box: curl -Ls https://github.com/humbug/box/releases/download/3.8.4/box.phar -o tools/box && chmod +x tools/box diff --git a/composer.json b/composer.json index a21ec84..eed4993 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,9 @@ "symfony/http-kernel": "^3.4 || ^4.4 || ^5.0", "zalas/phpunit-globals": "^2.0", "symfony/framework-bundle": "^3.4 || ^4.4 || ^5.0", - "zalas/phpunit-doubles": "^1.4", - "phpspec/prophecy": "^1.9" + "zalas/phpunit-doubles": "^1.5", + "phpspec/prophecy": "^1.9", + "phpspec/prophecy-phpunit": "dev-master" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 536e744..be0d7ef 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ assertCount(2, $resources); $this->assertContainsOnlyInstancesOf(ReflectionClassResource::class, $resources); - $this->assertRegExp('#'.\preg_quote(TestCase1::class, '#').'#', (string) $resources[0]); - $this->assertRegExp('#'.\preg_quote(TestCase2::class, '#').'#', (string) $resources[1]); + $this->assertMatchesRegularExpression('#'.\preg_quote(TestCase1::class, '#').'#', (string) $resources[0]); + $this->assertMatchesRegularExpression('#'.\preg_quote(TestCase2::class, '#').'#', (string) $resources[1]); } } diff --git a/tests/TestListener/ServiceInjectorListenerTest.php b/tests/TestListener/ServiceInjectorListenerTest.php index 633acf1..f51fc0b 100644 --- a/tests/TestListener/ServiceInjectorListenerTest.php +++ b/tests/TestListener/ServiceInjectorListenerTest.php @@ -6,6 +6,7 @@ use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestListener; +use Prophecy\PhpUnit\ProphecyTrait; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase; @@ -15,6 +16,8 @@ class ServiceInjectorListenerTest extends TestCase implements ServiceContainerTestCase { + use ProphecyTrait; + /** * @inject */ diff --git a/tests/TestListener/TestCaseContainerFactoryTest.php b/tests/TestListener/TestCaseContainerFactoryTest.php index e01e902..a84c57b 100644 --- a/tests/TestListener/TestCaseContainerFactoryTest.php +++ b/tests/TestListener/TestCaseContainerFactoryTest.php @@ -4,16 +4,18 @@ namespace Zalas\Injector\PHPUnit\Tests\TestListener; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\ObjectProphecy; use Psr\Container\ContainerInterface; use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase; use Zalas\Injector\PHPUnit\TestListener\TestCaseContainerFactory; use Zalas\Injector\Service\ContainerFactory; -use Zalas\PHPUnit\Doubles\TestCase\TestDoubles; +use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles; class TestCaseContainerFactoryTest extends TestCase { - use TestDoubles; + use ProphecyTrait; + use ProphecyTestDoubles; /** * @var TestCaseContainerFactory