From 31dfb8e3724a79f3a5d2672dde1204fc38668ed0 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Mon, 5 Jun 2023 20:47:51 -0400 Subject: [PATCH 1/4] Update dependency ranges and CI for 5.0 --- .github/workflows/ci.yaml | 25 ++++++++----------------- composer.json | 16 ++++++++-------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7538520..7b0bb4d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,21 +11,18 @@ jobs: strategy: matrix: php: - - '7.2' - - '7.3' - - '7.4' - - '8.0' + - '8.1' + - '8.2' dependency: - '' symfony: - - '4.4.*' - - '5.3.*' + - '5.4.*' + - '6.2.*' + - '6.3.*' include: - - php: '7.2' - symfony: '4.4.*' + - php: '8.1' + symfony: '5.4.*' dependency: 'lowest' - - php: '8.0' - symfony: '6.0.*' fail-fast: false steps: - name: Checkout @@ -38,18 +35,12 @@ jobs: extensions: pcov tools: flex - - name: Prefer unstable Composer dependencies for Symfony 6.0 - if: matrix.symfony == '6.0.*' - run: | - composer config prefer-stable false - composer config minimum-stability dev - - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/composer.json b/composer.json index 2fdf1f1..b07c788 100644 --- a/composer.json +++ b/composer.json @@ -13,17 +13,17 @@ } ], "require": { - "php": "^7.2 || ^8.0", - "matthiasnoback/symfony-config-test": "^4.0.1", - "symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0", - "symfony/config": "^4.4 || ^5.3 || ^6.0", - "symfony/yaml": "^4.4 || ^5.3 || ^6.0" + "php": "^8.1", + "matthiasnoback/symfony-config-test": "^5.0", + "symfony/dependency-injection": "^5.4 || ^6.2", + "symfony/config": "^5.4 || ^6.2", + "symfony/yaml": "^5.4 || ^6.2" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.6 || ^10.0" }, "conflict": { - "phpunit/phpunit": "<8.0" + "phpunit/phpunit": "<9.6 || >=11.0" }, "autoload": { "psr-4" : { "Matthias\\SymfonyDependencyInjectionTest\\" : "" }, @@ -34,7 +34,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } } } From 2a0eef69a7ed4f84c591685e66a08e9133c28f4b Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Mon, 5 Jun 2023 21:12:15 -0400 Subject: [PATCH 2/4] Address a number of PHPUnit deprecations --- Loader/LoaderFactory.php | 5 ---- Tests/Loader/LoaderFactoryTest.php | 26 ++++++++++--------- ...ContainerBuilderHasAliasConstraintTest.php | 2 +- ...lderHasServiceDefinitionConstraintTest.php | 2 +- ...mentEqualsServiceLocatorConstraintTest.php | 2 +- .../DefinitionDecoratesConstraintTest.php | 4 +-- .../DefinitionEqualsServiceLocatorTest.php | 4 +-- .../DefinitionHasArgumentConstraintTest.php | 8 +++--- .../DefinitionHasMethodCallConstraintTest.php | 2 +- .../DefinitionHasTagConstraintTest.php | 2 +- .../DefinitionIsChildOfConstraintTest.php | 2 +- phpunit.xml.dist | 26 +++++++++---------- 12 files changed, 41 insertions(+), 44 deletions(-) diff --git a/Loader/LoaderFactory.php b/Loader/LoaderFactory.php index 34c42cc..828d231 100644 --- a/Loader/LoaderFactory.php +++ b/Loader/LoaderFactory.php @@ -56,9 +56,4 @@ public function createPhpFileLoader(ContainerBuilder $container): PhpFileLoader { return new PhpFileLoader($container, new FileLocator()); } - - public function createIniFileLoader(ContainerBuilder $container): IniFileLoader - { - return new IniFileLoader($container, new FileLocator()); - } } diff --git a/Tests/Loader/LoaderFactoryTest.php b/Tests/Loader/LoaderFactoryTest.php index a5ce098..4c6c815 100644 --- a/Tests/Loader/LoaderFactoryTest.php +++ b/Tests/Loader/LoaderFactoryTest.php @@ -3,7 +3,13 @@ namespace Matthias\SymfonyDependencyInjectionTest\Tests\Loader; use Matthias\SymfonyDependencyInjectionTest\Loader\LoaderFactory; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\ClosureLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class LoaderFactoryTest extends TestCase { @@ -29,25 +35,21 @@ public function it_creates_a_closure_loader_when_source_is_a_closure(): void $factory = new LoaderFactory(); $loader = $factory->createLoaderForSource($this->createMockContainerBuilder(), $source); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Loader\ClosureLoader', $loader); + $this->assertInstanceOf(ClosureLoader::class, $loader); } - public function fileProvider() + public static function fileProvider() { return [ - ['file.xml', 'Symfony\Component\DependencyInjection\Loader\XmlFileLoader'], - ['file.yml', 'Symfony\Component\DependencyInjection\Loader\YamlFileLoader'], - ['file.yaml', 'Symfony\Component\DependencyInjection\Loader\YamlFileLoader'], - ['file.php', 'Symfony\Component\DependencyInjection\Loader\PhpFileLoader'], + ['file.xml', XmlFileLoader::class], + ['file.yml', YamlFileLoader::class], + ['file.yaml', YamlFileLoader::class], + ['file.php', PhpFileLoader::class], ]; } - private function createMockContainerBuilder() + private function createMockContainerBuilder(): MockObject&ContainerBuilder { - return $this - ->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') - ->disableOriginalConstructor() - ->setMethods(null) - ->getMock(); + return $this->createMock(ContainerBuilder::class); } } diff --git a/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php b/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php index acd8682..cbaeee3 100644 --- a/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php +++ b/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php @@ -19,7 +19,7 @@ public function match(ContainerBuilder $containerBuilder, $alias, $expectedServi $this->assertSame($shouldMatch, $constraint->evaluate($containerBuilder, '', true)); } - public function containerBuilderProvider() + public static function containerBuilderProvider() { $emptyContainerBuilder = new ContainerBuilder(); diff --git a/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php b/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php index 911cae7..994df3d 100644 --- a/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php +++ b/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php @@ -25,7 +25,7 @@ public function match( $this->assertSame($shouldMatch, $constraint->evaluate($containerBuilder, '', true)); } - public function containerBuilderProvider() + public static function containerBuilderProvider() { $emptyContainerBuilder = new ContainerBuilder(); diff --git a/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php b/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php index ab52be9..28fbe2d 100644 --- a/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php +++ b/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php @@ -65,7 +65,7 @@ public function if_fails_if_the_service_definition_value_is_not_a_valid_referenc $this->assertConstraintFails(new DefinitionArgumentEqualsServiceLocatorConstraint('using_service', 0, [new Reference('foo')])); } - public function provideInvalidServiceLocatorReferences() + public static function provideInvalidServiceLocatorReferences() { yield [['']]; yield [[null]]; diff --git a/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php b/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php index fa3e381..ffff9a6 100644 --- a/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php +++ b/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php @@ -21,7 +21,7 @@ public function match(ContainerBuilder $containerBuilder, bool $expectedToMatch, $this->assertSame($expectedToMatch, $constraint->evaluate($containerBuilder, '', true)); } - public function containerBuilderProvider(): iterable + public static function containerBuilderProvider(): iterable { $containerBuilder = new ContainerBuilder(); $containerBuilder->setDefinition('decorated1', new Definition('DecoratedClass1')); @@ -53,7 +53,7 @@ public function it_has_a_string_representation(DefinitionDecoratesConstraint $co $this->assertSame($expectedRepresentation, $constraint->toString()); } - public function stringRepresentationProvider(): iterable + public static function stringRepresentationProvider(): iterable { yield [new DefinitionDecoratesConstraint('decorator', 'decorated'), '"decorator" decorates service "decorated" with priority "0" and "RUNTIME_EXCEPTION_ON_INVALID_REFERENCE" behavior.']; yield [new DefinitionDecoratesConstraint('decorator', 'decorated', 'decorated_0'), '"decorator" decorates service "decorated" and renames it to "decorated_0" with priority "0" and "RUNTIME_EXCEPTION_ON_INVALID_REFERENCE" behavior.']; diff --git a/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php b/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php index c8e4fab..e994a07 100644 --- a/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php +++ b/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php @@ -49,7 +49,7 @@ public function if_fails_if_the_service_definition_value_is_not_a_valid_referenc ); } - public function provideInvalidServiceLocatorReferences() + public static function provideInvalidServiceLocatorReferences() { yield [['']]; yield [[null]]; @@ -70,7 +70,7 @@ public function it_does_not_fail_if_the_service_definition_is_a_service_locator( ); } - public function provideValidServiceLocatorDefs() + public static function provideValidServiceLocatorDefs() { // Data providers get called before setUp? if (!class_exists(ServiceLocator::class)) { diff --git a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php index 0e6ae76..88ef166 100644 --- a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php @@ -22,7 +22,7 @@ public function match(Definition $definition, $argumentIndex, $expectedValue, $s $this->assertSame($shouldMatch, $constraint->evaluate($definition, '', true)); } - public function definitionProvider() + public static function definitionProvider() { $definitionWithNoArguments = new Definition(); @@ -72,7 +72,7 @@ public function validates_definitionIndex($argument, $exceptionMessage): void /** * @return \Generator */ - public function invalid_definition_indexes() + public static function invalid_definition_indexes() { yield [ new \stdClass(), 'Expected either a string or a positive integer for $argumentIndex.', @@ -133,7 +133,7 @@ public function supports_indexed_arguments($argumentIndex): void /** * @return \Generator */ - public function indexed_arguments() + public static function indexed_arguments() { // yield [0]; yield [1]; @@ -181,7 +181,7 @@ public function supports_named_arguments($argument): void /** * @return \Generator */ - public function named_arguments() + public static function named_arguments() { yield ['$foo']; yield ['$bar']; diff --git a/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php b/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php index a109ca8..6096bd7 100644 --- a/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php @@ -19,7 +19,7 @@ public function match(Definition $definition, $method, $arguments, $index, $expe $this->assertSame($expectedToMatch, $constraint->evaluate($definition, '', true)); } - public function definitionProvider() + public static function definitionProvider() { $definitionWithNoMethodCalls = new Definition(); diff --git a/Tests/PhpUnit/DefinitionHasTagConstraintTest.php b/Tests/PhpUnit/DefinitionHasTagConstraintTest.php index 4765320..489cdbc 100644 --- a/Tests/PhpUnit/DefinitionHasTagConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasTagConstraintTest.php @@ -40,7 +40,7 @@ public function evaluateThrowsExceptionOnFailure(Definition $definition, $tag, $ } } - public function definitionProvider() + public static function definitionProvider() { $definitionWithoutTags = new Definition(); $definitionWithTwoTags = new Definition(); diff --git a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php index 43355b7..7ef807a 100644 --- a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php +++ b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php @@ -21,7 +21,7 @@ public function match(Definition $definition, $parentServiceId, $expectedToMatch $this->assertSame($expectedToMatch, $constraint->evaluate($definition, '', true)); } - public function definitionProvider() + public static function definitionProvider() { $definition = new Definition(); if (class_exists(ChildDefinition::class)) { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 016cf5a..27de55f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,24 +1,24 @@ + colors="true" +> - Tests + Tests - - - . - - Tests - vendor - - - + + + ./ + + + ./Tests + ./vendor + + From fd906557e41c88f04700747c4d10ff3cce6f401b Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Mon, 5 Jun 2023 21:16:43 -0400 Subject: [PATCH 3/4] Remove compat code --- Tests/Fixtures/SimpleConfiguration.php | 7 +------ ...initionArgumentEqualsServiceLocatorConstraintTest.php | 4 ---- Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php | 9 --------- Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php | 6 +----- Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php | 6 +----- 5 files changed, 3 insertions(+), 29 deletions(-) diff --git a/Tests/Fixtures/SimpleConfiguration.php b/Tests/Fixtures/SimpleConfiguration.php index d781bff..33d287d 100644 --- a/Tests/Fixtures/SimpleConfiguration.php +++ b/Tests/Fixtures/SimpleConfiguration.php @@ -10,12 +10,7 @@ class SimpleConfiguration implements ConfigurationInterface public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('simple'); - - if (method_exists($treeBuilder, 'getRootNode')) { - $rootNode = $treeBuilder->getRootNode(); - } else { - $rootNode = $treeBuilder->root('simple'); - } + $rootNode = $treeBuilder->getRootNode(); $rootNode ->fixXmlConfig('type', 'types') diff --git a/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php b/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php index 28fbe2d..2464543 100644 --- a/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php +++ b/Tests/PhpUnit/DefinitionArgumentEqualsServiceLocatorConstraintTest.php @@ -22,10 +22,6 @@ final class DefinitionArgumentEqualsServiceLocatorConstraintTest extends TestCas protected function setUp(): void { - if (!class_exists(ServiceLocator::class)) { - $this->markTestSkipped('Requires the Symfony DependencyInjection component v3.4 or higher'); - } - $this->containerBuilder = new ContainerBuilder(); } diff --git a/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php b/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php index e994a07..5a6d5f7 100644 --- a/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php +++ b/Tests/PhpUnit/DefinitionEqualsServiceLocatorTest.php @@ -20,10 +20,6 @@ final class DefinitionEqualsServiceLocatorTest extends TestCase protected function setUp(): void { - if (!class_exists(ServiceLocator::class)) { - $this->markTestSkipped('Requires the Symfony DependencyInjection component v3.4 or higher'); - } - $this->containerBuilder = new ContainerBuilder(); } @@ -72,11 +68,6 @@ public function it_does_not_fail_if_the_service_definition_is_a_service_locator( public static function provideValidServiceLocatorDefs() { - // Data providers get called before setUp? - if (!class_exists(ServiceLocator::class)) { - return [[], []]; - } - yield [ ['bar' => new ServiceClosureArgument(new Reference('foo'))], ['bar' => new Reference('foo')], diff --git a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php index 88ef166..7e271d0 100644 --- a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php @@ -33,11 +33,7 @@ public static function definitionProvider() $definitionWithArguments->setArguments($arguments); $parentServiceId = 'parent_service_id'; - if (class_exists(ChildDefinition::class)) { - $decoratedDefinitionWithArguments = new ChildDefinition($parentServiceId); - } else { - $decoratedDefinitionWithArguments = new DefinitionDecorator($parentServiceId); - } + $decoratedDefinitionWithArguments = new ChildDefinition($parentServiceId); $decoratedDefinitionWithArguments->setArguments([0 => 'first argument', 1 => $wrongValue]); $decoratedDefinitionWithArguments->replaceArgument(1, $rightValue); diff --git a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php index 7ef807a..68f3b5c 100644 --- a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php +++ b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php @@ -24,11 +24,7 @@ public function match(Definition $definition, $parentServiceId, $expectedToMatch public static function definitionProvider() { $definition = new Definition(); - if (class_exists(ChildDefinition::class)) { - $decoratedDefinition = new ChildDefinition('parent_service_id'); - } else { - $decoratedDefinition = new DefinitionDecorator('parent_service_id'); - } + $decoratedDefinition = new ChildDefinition('parent_service_id'); return [ // the provided definition has the same parent service id From 990ed03152f2ad78b9b36e2c74b26dd376850b5d Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Mon, 5 Jun 2023 21:35:52 -0400 Subject: [PATCH 4/4] Apply CS fixes --- Loader/LoaderFactory.php | 1 - Tests/Loader/LoaderFactoryTest.php | 1 + Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php | 1 + .../ContainerBuilderHasServiceDefinitionConstraintTest.php | 1 + Tests/PhpUnit/DefinitionDecoratesConstraintTest.php | 2 ++ Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php | 5 ++++- Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php | 1 + Tests/PhpUnit/DefinitionHasTagConstraintTest.php | 2 ++ Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php | 1 + 9 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Loader/LoaderFactory.php b/Loader/LoaderFactory.php index 828d231..f1b05ab 100644 --- a/Loader/LoaderFactory.php +++ b/Loader/LoaderFactory.php @@ -7,7 +7,6 @@ use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\ClosureLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; diff --git a/Tests/Loader/LoaderFactoryTest.php b/Tests/Loader/LoaderFactoryTest.php index 4c6c815..de17e1e 100644 --- a/Tests/Loader/LoaderFactoryTest.php +++ b/Tests/Loader/LoaderFactoryTest.php @@ -15,6 +15,7 @@ class LoaderFactoryTest extends TestCase { /** * @test + * * @dataProvider fileProvider */ public function it_creates_the_appropriate_file_loader_based_on_the_extension($file, $expectedClass): void diff --git a/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php b/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php index cbaeee3..428df7d 100644 --- a/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php +++ b/Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php @@ -10,6 +10,7 @@ class ContainerBuilderHasAliasConstraintTest extends TestCase { /** * @test + * * @dataProvider containerBuilderProvider */ public function match(ContainerBuilder $containerBuilder, $alias, $expectedServiceId, $shouldMatch): void diff --git a/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php b/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php index 994df3d..8f23984 100644 --- a/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php +++ b/Tests/PhpUnit/ContainerBuilderHasServiceDefinitionConstraintTest.php @@ -11,6 +11,7 @@ class ContainerBuilderHasServiceDefinitionConstraintTest extends TestCase { /** * @test + * * @dataProvider containerBuilderProvider */ public function match( diff --git a/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php b/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php index ffff9a6..9864384 100644 --- a/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php +++ b/Tests/PhpUnit/DefinitionDecoratesConstraintTest.php @@ -12,6 +12,7 @@ class DefinitionDecoratesConstraintTest extends TestCase { /** * @test + * * @dataProvider containerBuilderProvider */ public function match(ContainerBuilder $containerBuilder, bool $expectedToMatch, string $serviceId, string $decoratedServiceId, ?string $renamedId, int $priority, ?int $invalidBehavior): void @@ -46,6 +47,7 @@ public static function containerBuilderProvider(): iterable /** * @test + * * @dataProvider stringRepresentationProvider */ public function it_has_a_string_representation(DefinitionDecoratesConstraint $constraint, string $expectedRepresentation): void diff --git a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php index 7e271d0..2988272 100644 --- a/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasArgumentConstraintTest.php @@ -7,12 +7,12 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\DefinitionDecorator; class DefinitionHasArgumentConstraintTest extends TestCase { /** * @test + * * @dataProvider definitionProvider */ public function match(Definition $definition, $argumentIndex, $expectedValue, $shouldMatch): void @@ -52,6 +52,7 @@ public static function definitionProvider() /** * @test + * * @dataProvider invalid_definition_indexes * * @param mixed $argument @@ -93,6 +94,7 @@ public static function invalid_definition_indexes() /** * @test + * * @dataProvider indexed_arguments * * @param int $argumentIndex @@ -139,6 +141,7 @@ public static function indexed_arguments() /** * @test + * * @dataProvider named_arguments * * @param string $argument diff --git a/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php b/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php index 6096bd7..a9ce7ac 100644 --- a/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasMethodCallConstraintTest.php @@ -10,6 +10,7 @@ class DefinitionHasMethodCallConstraintTest extends TestCase { /** * @test + * * @dataProvider definitionProvider */ public function match(Definition $definition, $method, $arguments, $index, $expectedToMatch): void diff --git a/Tests/PhpUnit/DefinitionHasTagConstraintTest.php b/Tests/PhpUnit/DefinitionHasTagConstraintTest.php index 489cdbc..edb10f3 100644 --- a/Tests/PhpUnit/DefinitionHasTagConstraintTest.php +++ b/Tests/PhpUnit/DefinitionHasTagConstraintTest.php @@ -11,6 +11,7 @@ class DefinitionHasTagConstraintTest extends TestCase { /** * @test + * * @dataProvider definitionProvider */ public function match(Definition $definition, $tag, $attributes, $expectedToMatch): void @@ -22,6 +23,7 @@ public function match(Definition $definition, $tag, $attributes, $expectedToMatc /** * @test + * * @dataProvider definitionProvider */ public function evaluateThrowsExceptionOnFailure(Definition $definition, $tag, $attributes, $expectedToMatch): void diff --git a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php index 68f3b5c..e5905cc 100644 --- a/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php +++ b/Tests/PhpUnit/DefinitionIsChildOfConstraintTest.php @@ -12,6 +12,7 @@ class DefinitionIsChildOfConstraintTest extends TestCase { /** * @test + * * @dataProvider definitionProvider */ public function match(Definition $definition, $parentServiceId, $expectedToMatch): void