diff --git a/README.md b/README.md index 6abc93c..6306425 100644 --- a/README.md +++ b/README.md @@ -268,10 +268,11 @@ public function processed_configuration_for_array_node_1(): void ## Version Guidance -| Version | Released | PHPUnit | Status | -|---------|--------------| ----------------------|------------| -| 5.x | Jun 2, 2023 | 9.6 and 10.x and 11.x | Latest | -| 4.x | Mar 5, 2018 | 7.x and 8.x and 9.x | Bugfixes | -| 3.x | Nov 30, 2017 | 6.x   | EOL | -| 2.x | Jun 18, 2016 | 4.x and 5.x | EOL | -| 1.x | Oct 12, 2014 | 3.x | EOL | +| Version | Released | PHPUnit | Status | +|---------|--------------|------------------------|----------| +| 6.x | Feb 7, 2025 | 10.5 and 11.x and 12.x | Latest | +| 5.x | Jun 2, 2023 | 9.6 and 10.x and 11.x | Bugfixes | +| 4.x | Mar 5, 2018 | 7.x and 8.x and 9.x | EOL | +| 3.x | Nov 30, 2017 | 6.x | EOL | +| 2.x | Jun 18, 2016 | 4.x and 5.x | EOL | +| 1.x | Oct 12, 2014 | 3.x | EOL | diff --git a/Tests/Partial/PartialNodeTest.php b/Tests/Partial/PartialNodeTest.php index ef6cf00..c0abc4d 100644 --- a/Tests/Partial/PartialNodeTest.php +++ b/Tests/Partial/PartialNodeTest.php @@ -5,6 +5,7 @@ use Matthias\SymfonyConfigTest\Partial\Exception\ChildIsNotAnArrayNode; use Matthias\SymfonyConfigTest\Partial\Exception\UndefinedChildNode; use Matthias\SymfonyConfigTest\Partial\PartialNode; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\ArrayNode; use Symfony\Component\Config\Definition\Builder\TreeBuilder; @@ -12,9 +13,7 @@ class PartialNodeTest extends TestCase { - /** - * @test - */ + #[Test] public function it_strips_children_that_are_not_in_the_given_path_with_one_name() { $treeBuilder = new TreeBuilder('root'); @@ -39,9 +38,7 @@ public function it_strips_children_that_are_not_in_the_given_path_with_one_name( $this->nodeOnlyHasChild($node, 'node_2'); } - /** - * @test - */ + #[Test] public function it_strips_children_that_are_not_in_the_given_path_with_several_names() { $treeBuilder = new TreeBuilder('root'); @@ -77,9 +74,7 @@ public function it_strips_children_that_are_not_in_the_given_path_with_several_n $this->nodeOnlyHasChild($node1, 'node_1_b'); } - /** - * @test - */ + #[Test] public function it_strips_children_when_leaf_node_is_not_an_array() { $treeBuilder = new TreeBuilder('root'); @@ -104,9 +99,7 @@ public function it_strips_children_when_leaf_node_is_not_an_array() $this->nodeOnlyHasChild($node, 'node_3'); } - /** - * @test - */ + #[Test] public function it_does_not_crash_on_prototypes() { $treeBuilder = new TreeBuilder('root'); @@ -134,9 +127,7 @@ public function it_does_not_crash_on_prototypes() $this->nodeOnlyHasChild($prototypeNode, 'node_1'); } - /** - * @test - */ + #[Test] public function it_fails_when_a_requested_child_node_does_not_exist() { $treeBuilder = new TreeBuilder('root'); @@ -155,9 +146,7 @@ public function it_fails_when_a_requested_child_node_does_not_exist() PartialNode::excludeEverythingNotInPath($node, ['sub_node', 'non_existing_node']); } - /** - * @test - */ + #[Test] public function it_fails_when_a_requested_child_node_is_no_array_node_itself_and_path_not_empty() { $treeBuilder = new TreeBuilder('root'); diff --git a/Tests/Partial/PartialProcessorTest.php b/Tests/Partial/PartialProcessorTest.php index 81761fd..cece86b 100644 --- a/Tests/Partial/PartialProcessorTest.php +++ b/Tests/Partial/PartialProcessorTest.php @@ -4,14 +4,13 @@ use Matthias\SymfonyConfigTest\Partial\PartialProcessor; use Matthias\SymfonyConfigTest\Tests\Partial\Fixtures\ConfigurationStub; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Builder\TreeBuilder; class PartialProcessorTest extends TestCase { - /** - * @test - */ + #[Test] public function it_processes_only_the_values_in_the_breadcrumb_path_for_a_given_node() { $treeBuilder = new TreeBuilder('root'); @@ -56,9 +55,7 @@ public function it_processes_only_the_values_in_the_breadcrumb_path_for_a_given_ ); } - /** - * @test - */ + #[Test] public function it_processes_only_the_values_in_the_given_breadcrumb_path_for_a_given_configuration_instance() { $partialProcessor = new PartialProcessor(); diff --git a/Tests/PhpUnit/ConfigurationTestCaseTraitTest.php b/Tests/PhpUnit/ConfigurationTestCaseTraitTest.php index 45158eb..c5604e5 100644 --- a/Tests/PhpUnit/ConfigurationTestCaseTraitTest.php +++ b/Tests/PhpUnit/ConfigurationTestCaseTraitTest.php @@ -4,6 +4,7 @@ use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\ConfigurationWithRequiredValue; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; @@ -16,9 +17,7 @@ protected function getConfiguration() return new ConfigurationWithRequiredValue(); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_configuration_is_invalid() { $this->assertConfigurationIsInvalid( @@ -29,9 +28,7 @@ public function it_can_assert_that_a_configuration_is_invalid() ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_configuration_is_valid_when_it_should_have_been_invalid() { $this->expectException(ExpectationFailedException::class); @@ -44,9 +41,7 @@ public function it_fails_when_a_configuration_is_valid_when_it_should_have_been_ ); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_configuration_is_valid() { $this->assertConfigurationIsValid( @@ -56,9 +51,7 @@ public function it_can_assert_that_a_configuration_is_valid() ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_configuration_is_invalid_when_it_should_have_been_valid() { $this->expectException(ExpectationFailedException::class); @@ -72,9 +65,7 @@ public function it_fails_when_a_configuration_is_invalid_when_it_should_have_bee ); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_processed_configuration_matches_the_expected_array_of_values() { $value = 'some value'; @@ -90,9 +81,7 @@ public function it_can_assert_that_a_processed_configuration_matches_the_expecte ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_processed_configuration_does_not_match_the_expected_array_of_values() { $value = 'some value'; @@ -110,9 +99,7 @@ public function it_fails_when_a_processed_configuration_does_not_match_the_expec ); } - /** - * @test - */ + #[Test] public function it_throws_a_comparison_failed_exception_with_the_values_in_the_right_order() { $value = 'some value'; diff --git a/Tests/PhpUnit/ConfigurationValuesAreInvalidConstraintTest.php b/Tests/PhpUnit/ConfigurationValuesAreInvalidConstraintTest.php index bf3ff04..9ae1237 100644 --- a/Tests/PhpUnit/ConfigurationValuesAreInvalidConstraintTest.php +++ b/Tests/PhpUnit/ConfigurationValuesAreInvalidConstraintTest.php @@ -5,13 +5,12 @@ use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationValuesAreInvalidConstraint; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\AlwaysValidConfiguration; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\ConfigurationWithRequiredValue; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; class ConfigurationValuesAreInvalidConstraintTest extends TestCase { - /** - * @test - */ + #[Test] public function if_configuration_values_is_no_array_it_fails() { $constraint = new ConfigurationValuesAreInvalidConstraint(new AlwaysValidConfiguration()); @@ -22,9 +21,7 @@ public function if_configuration_values_is_no_array_it_fails() $constraint->evaluate('not an array'); } - /** - * @test - */ + #[Test] public function if_configuration_values_is_no_array_of_arrays_it_fails() { $constraint = new ConfigurationValuesAreInvalidConstraint(new AlwaysValidConfiguration()); @@ -35,9 +32,7 @@ public function if_configuration_values_is_no_array_of_arrays_it_fails() $constraint->evaluate(['not an array']); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_valid_it_does_not_match() { $constraint = new ConfigurationValuesAreInvalidConstraint(new AlwaysValidConfiguration()); @@ -45,9 +40,7 @@ public function if_configuration_values_are_valid_it_does_not_match() $this->assertFalse($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_invalid_it_matches() { $constraint = new ConfigurationValuesAreInvalidConstraint(new ConfigurationWithRequiredValue()); @@ -55,9 +48,7 @@ public function if_configuration_values_are_invalid_it_matches() $this->assertTrue($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_invalid_it_does_not_match_when_exception_message_is_not_right() { $constraint = new ConfigurationValuesAreInvalidConstraint( @@ -68,9 +59,7 @@ public function if_configuration_values_are_invalid_it_does_not_match_when_excep $this->assertFalse($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_invalid_it_matches_when_exception_message_is_right() { $constraint = new ConfigurationValuesAreInvalidConstraint( @@ -81,9 +70,7 @@ public function if_configuration_values_are_invalid_it_matches_when_exception_me $this->assertTrue($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_invalid_it_matches_when_exception_message_is_right_according_to_regexp() { $constraint = new ConfigurationValuesAreInvalidConstraint( @@ -95,9 +82,7 @@ public function if_configuration_values_are_invalid_it_matches_when_exception_me $this->assertTrue($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function to_string_returns_a_message() { $constraint = new ConfigurationValuesAreInvalidConstraint( @@ -107,9 +92,7 @@ public function to_string_returns_a_message() $this->assertSame('is invalid for the given configuration', $constraint->toString()); } - /** - * @test - */ + #[Test] public function to_string_also_mentions_the_expected_exception_message() { $expectedMessage = 'the expected message'; diff --git a/Tests/PhpUnit/ConfigurationValuesAreValidConstraintTest.php b/Tests/PhpUnit/ConfigurationValuesAreValidConstraintTest.php index 26172cd..946b38c 100644 --- a/Tests/PhpUnit/ConfigurationValuesAreValidConstraintTest.php +++ b/Tests/PhpUnit/ConfigurationValuesAreValidConstraintTest.php @@ -5,13 +5,12 @@ use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationValuesAreValidConstraint; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\AlwaysValidConfiguration; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\ConfigurationWithRequiredValue; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; class ConfigurationValuesAreValidConstraintTest extends TestCase { - /** - * @test - */ + #[Test] public function if_configuration_values_is_no_array_it_fails() { $constraint = new ConfigurationValuesAreValidConstraint(new AlwaysValidConfiguration()); @@ -22,9 +21,7 @@ public function if_configuration_values_is_no_array_it_fails() $constraint->evaluate('not an array'); } - /** - * @test - */ + #[Test] public function if_configuration_values_is_no_array_of_arrays_it_fails() { $constraint = new ConfigurationValuesAreValidConstraint(new AlwaysValidConfiguration()); @@ -35,9 +32,7 @@ public function if_configuration_values_is_no_array_of_arrays_it_fails() $constraint->evaluate(['not an array']); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_valid_it_matches() { $constraint = new ConfigurationValuesAreValidConstraint(new AlwaysValidConfiguration()); @@ -45,9 +40,7 @@ public function if_configuration_values_are_valid_it_matches() $this->assertTrue($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function if_configuration_values_are_invalid_it_does_not_match() { $constraint = new ConfigurationValuesAreValidConstraint(new ConfigurationWithRequiredValue()); @@ -55,9 +48,7 @@ public function if_configuration_values_are_invalid_it_does_not_match() $this->assertFalse($constraint->evaluate([[]], '', true)); } - /** - * @test - */ + #[Test] public function to_string_returns_a_message() { $constraint = new ConfigurationValuesAreValidConstraint(new AlwaysValidConfiguration()); diff --git a/Tests/PhpUnit/PartialConfigurationIntegrationTest.php b/Tests/PhpUnit/PartialConfigurationIntegrationTest.php index 007188a..cbdcd5c 100644 --- a/Tests/PhpUnit/PartialConfigurationIntegrationTest.php +++ b/Tests/PhpUnit/PartialConfigurationIntegrationTest.php @@ -4,6 +4,7 @@ use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\ConfigurationWithMultipleArrayKeys; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; @@ -16,9 +17,7 @@ protected function getConfiguration() return new ConfigurationWithMultipleArrayKeys(); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_configuration_is_invalid() { $this->assertPartialConfigurationIsInvalid( @@ -30,9 +29,7 @@ public function it_can_assert_that_a_configuration_is_invalid() ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_configuration_is_valid_when_it_should_have_been_invalid() { $this->expectException(ExpectationFailedException::class); @@ -50,9 +47,7 @@ public function it_fails_when_a_configuration_is_valid_when_it_should_have_been_ ); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_configuration_is_valid() { $this->assertConfigurationIsValid( @@ -67,9 +62,7 @@ public function it_can_assert_that_a_configuration_is_valid() ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_configuration_is_invalid_when_it_should_have_been_valid() { $this->expectException(ExpectationFailedException::class); @@ -83,9 +76,7 @@ public function it_fails_when_a_configuration_is_invalid_when_it_should_have_bee ); } - /** - * @test - */ + #[Test] public function it_can_assert_that_a_processed_configuration_matches_the_expected_array_of_values() { $value = 'some value'; @@ -109,9 +100,7 @@ public function it_can_assert_that_a_processed_configuration_matches_the_expecte ); } - /** - * @test - */ + #[Test] public function it_fails_when_a_processed_configuration_does_not_match_the_expected_array_of_values() { $value = 'some value'; @@ -133,9 +122,7 @@ public function it_fails_when_a_processed_configuration_does_not_match_the_expec ); } - /** - * @test - */ + #[Test] public function it_throws_a_comparison_failed_exception_with_the_values_in_the_right_order() { $value = 'some value'; diff --git a/Tests/PhpUnit/ProcessedConfigurationEqualsConstraintTest.php b/Tests/PhpUnit/ProcessedConfigurationEqualsConstraintTest.php index d1703e2..4e20f68 100644 --- a/Tests/PhpUnit/ProcessedConfigurationEqualsConstraintTest.php +++ b/Tests/PhpUnit/ProcessedConfigurationEqualsConstraintTest.php @@ -5,13 +5,12 @@ use Matthias\SymfonyConfigTest\PhpUnit\ProcessedConfigurationEqualsConstraint; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\AlwaysValidConfiguration; use Matthias\SymfonyConfigTest\Tests\PhpUnit\Fixtures\ConfigurationWithRequiredValue; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; class ProcessedConfigurationEqualsConstraintTest extends TestCase { - /** - * @test - */ + #[Test] public function if_configuration_is_invalid_it_does_not_match() { $constraint = new ProcessedConfigurationEqualsConstraint( @@ -22,9 +21,7 @@ public function if_configuration_is_invalid_it_does_not_match() $this->assertFalse($constraint->evaluate(['non-existing-key' => []], '', true)); } - /** - * @test - */ + #[Test] public function if_processed_configuration_equals_the_expected_values_it_matches() { $value = 'some value'; @@ -37,9 +34,7 @@ public function if_processed_configuration_equals_the_expected_values_it_matches $this->assertTrue($constraint->evaluate(['required_value'=> $value], '', true)); } - /** - * @test - */ + #[Test] public function to_string_is_not_implemented() { $constraint = new ProcessedConfigurationEqualsConstraint( diff --git a/composer.json b/composer.json index a4d1748..c519220 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "require": { "php": "^8.1", - "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0", + "phpunit/phpunit": "^10.5 || ^11.0 || ^12.0", "symfony/config": "^5.4 || ^6.2 || ^7.0" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7a11f55..05acf8b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,24 +1,17 @@ - - - - Tests - - - - - - ./ - - - ./Tests - ./vendor - - + + + + Tests + + + + + ./ + + + ./Tests + ./vendor + +