Skip to content

Commit 1dce70f

Browse files
authored
Merge pull request #31 from jakzal/phpunit-fix
Update the method definition to match the one in updated phpunit
2 parents b1cfce2 + 1211fd0 commit 1dce70f

7 files changed

+23
-13
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ tools/deptrac:
9393
curl -Ls http://get.sensiolabs.de/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
9494

9595
tools/infection: tools/infection.pubkey
96-
curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar -o tools/infection && chmod +x tools/infection
96+
curl -Ls https://github.com/infection/infection/releases/download/0.16.1/infection.phar -o tools/infection && chmod +x tools/infection
9797

9898
tools/infection.pubkey:
99-
curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar.pubkey -o tools/infection.pubkey
99+
curl -Ls https://github.com/infection/infection/releases/download/0.16.1/infection.phar.pubkey -o tools/infection.pubkey
100100

101101
tools/box:
102102
curl -Ls https://github.com/humbug/box/releases/download/3.8.4/box.phar -o tools/box && chmod +x tools/box

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
"symfony/http-kernel": "^3.4 || ^4.4 || ^5.0",
1515
"zalas/phpunit-globals": "^2.0",
1616
"symfony/framework-bundle": "^3.4 || ^4.4 || ^5.0",
17-
"zalas/phpunit-doubles": "^1.4",
18-
"phpspec/prophecy": "^1.9"
17+
"zalas/phpunit-doubles": "^1.5",
18+
"phpspec/prophecy": "^1.9",
19+
"phpspec/prophecy-phpunit": "dev-master"
1920
},
2021
"autoload": {
2122
"psr-4": {

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.0/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.1/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
beStrictAboutOutputDuringTests="true"
66
beStrictAboutTodoAnnotatedTests="true"

tests/Symfony/Compiler/Discovery/PropertyDiscoveryTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use PHPUnit\Framework\TestCase;
77
use Prophecy\Argument;
8+
use Prophecy\PhpUnit\ProphecyTrait;
89
use Prophecy\Prophecy\ObjectProphecy;
910
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\ClassFinder;
1011
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\PropertyDiscovery;
@@ -15,11 +16,12 @@
1516
use Zalas\Injector\Service\Extractor;
1617
use Zalas\Injector\Service\ExtractorFactory;
1718
use Zalas\Injector\Service\Property;
18-
use Zalas\PHPUnit\Doubles\TestCase\TestDoubles;
19+
use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles;
1920

2021
class PropertyDiscoveryTest extends TestCase
2122
{
22-
use TestDoubles;
23+
use ProphecyTrait;
24+
use ProphecyTestDoubles;
2325

2426
/**
2527
* @var PropertyDiscovery

tests/Symfony/Compiler/ExposeServicesForTestsPassTest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Zalas\Injector\PHPUnit\Tests\Symfony\Compiler;
55

66
use PHPUnit\Framework\TestCase;
7+
use Prophecy\PhpUnit\ProphecyTrait;
78
use Prophecy\Prophecy\ObjectProphecy;
89
use Symfony\Component\Config\Resource\ReflectionClassResource;
910
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -18,11 +19,12 @@
1819
use Zalas\Injector\PHPUnit\Tests\Symfony\Compiler\Fixtures\TestCase1;
1920
use Zalas\Injector\PHPUnit\Tests\Symfony\Compiler\Fixtures\TestCase2;
2021
use Zalas\Injector\Service\Property;
21-
use Zalas\PHPUnit\Doubles\TestCase\TestDoubles;
22+
use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles;
2223

2324
class ExposeServicesForTestsPassTest extends TestCase
2425
{
25-
use TestDoubles;
26+
use ProphecyTrait;
27+
use ProphecyTestDoubles;
2628

2729
/**
2830
* @var ExposeServicesForTestsPass
@@ -97,7 +99,7 @@ public function test_it_registers_test_cases_as_container_resources()
9799

98100
$this->assertCount(2, $resources);
99101
$this->assertContainsOnlyInstancesOf(ReflectionClassResource::class, $resources);
100-
$this->assertRegExp('#'.\preg_quote(TestCase1::class, '#').'#', (string) $resources[0]);
101-
$this->assertRegExp('#'.\preg_quote(TestCase2::class, '#').'#', (string) $resources[1]);
102+
$this->assertMatchesRegularExpression('#'.\preg_quote(TestCase1::class, '#').'#', (string) $resources[0]);
103+
$this->assertMatchesRegularExpression('#'.\preg_quote(TestCase2::class, '#').'#', (string) $resources[1]);
102104
}
103105
}

tests/TestListener/ServiceInjectorListenerTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPUnit\Framework\Test;
77
use PHPUnit\Framework\TestCase;
88
use PHPUnit\Framework\TestListener;
9+
use Prophecy\PhpUnit\ProphecyTrait;
910
use Psr\Container\ContainerInterface;
1011
use Psr\Container\NotFoundExceptionInterface;
1112
use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase;
@@ -15,6 +16,8 @@
1516

1617
class ServiceInjectorListenerTest extends TestCase implements ServiceContainerTestCase
1718
{
19+
use ProphecyTrait;
20+
1821
/**
1922
* @inject
2023
*/

tests/TestListener/TestCaseContainerFactoryTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
namespace Zalas\Injector\PHPUnit\Tests\TestListener;
55

66
use PHPUnit\Framework\TestCase;
7+
use Prophecy\PhpUnit\ProphecyTrait;
78
use Prophecy\Prophecy\ObjectProphecy;
89
use Psr\Container\ContainerInterface;
910
use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase;
1011
use Zalas\Injector\PHPUnit\TestListener\TestCaseContainerFactory;
1112
use Zalas\Injector\Service\ContainerFactory;
12-
use Zalas\PHPUnit\Doubles\TestCase\TestDoubles;
13+
use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles;
1314

1415
class TestCaseContainerFactoryTest extends TestCase
1516
{
16-
use TestDoubles;
17+
use ProphecyTrait;
18+
use ProphecyTestDoubles;
1719

1820
/**
1921
* @var TestCaseContainerFactory

0 commit comments

Comments
 (0)