Skip to content

Commit

Permalink
Merge pull request #31 from jakzal/phpunit-fix
Browse files Browse the repository at this point in the history
Update the method definition to match the one in updated phpunit
  • Loading branch information
jakzal authored Apr 6, 2020
2 parents b1cfce2 + 1211fd0 commit 1dce70f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.1/phpunit.xsd"
bootstrap="vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
Expand Down
6 changes: 4 additions & 2 deletions tests/Symfony/Compiler/Discovery/PropertyDiscoveryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\ClassFinder;
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\PropertyDiscovery;
Expand All @@ -15,11 +16,12 @@
use Zalas\Injector\Service\Extractor;
use Zalas\Injector\Service\ExtractorFactory;
use Zalas\Injector\Service\Property;
use Zalas\PHPUnit\Doubles\TestCase\TestDoubles;
use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles;

class PropertyDiscoveryTest extends TestCase
{
use TestDoubles;
use ProphecyTrait;
use ProphecyTestDoubles;

/**
* @var PropertyDiscovery
Expand Down
10 changes: 6 additions & 4 deletions tests/Symfony/Compiler/ExposeServicesForTestsPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Zalas\Injector\PHPUnit\Tests\Symfony\Compiler;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\Config\Resource\ReflectionClassResource;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand All @@ -18,11 +19,12 @@
use Zalas\Injector\PHPUnit\Tests\Symfony\Compiler\Fixtures\TestCase1;
use Zalas\Injector\PHPUnit\Tests\Symfony\Compiler\Fixtures\TestCase2;
use Zalas\Injector\Service\Property;
use Zalas\PHPUnit\Doubles\TestCase\TestDoubles;
use Zalas\PHPUnit\Doubles\TestCase\ProphecyTestDoubles;

class ExposeServicesForTestsPassTest extends TestCase
{
use TestDoubles;
use ProphecyTrait;
use ProphecyTestDoubles;

/**
* @var ExposeServicesForTestsPass
Expand Down Expand Up @@ -97,7 +99,7 @@ public function test_it_registers_test_cases_as_container_resources()

$this->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]);
}
}
3 changes: 3 additions & 0 deletions tests/TestListener/ServiceInjectorListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,6 +16,8 @@

class ServiceInjectorListenerTest extends TestCase implements ServiceContainerTestCase
{
use ProphecyTrait;

/**
* @inject
*/
Expand Down
6 changes: 4 additions & 2 deletions tests/TestListener/TestCaseContainerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1dce70f

Please sign in to comment.