From f25be99273aec65489b7decf508340c2462cf56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 3 Jan 2022 18:32:52 +0100 Subject: [PATCH 1/2] Enhancement: Use Php73 rule set --- .php_cs | 2 +- .php_cs.fixture | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.php_cs b/.php_cs index 162ed36..15d538d 100644 --- a/.php_cs +++ b/.php_cs @@ -26,7 +26,7 @@ $license = License\Type\MIT::markdown( $license->save(); -$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php71($license->header()), [ +$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php73($license->header()), [ 'strict_comparison' => false, ]); diff --git a/.php_cs.fixture b/.php_cs.fixture index 18bbb12..938f12e 100644 --- a/.php_cs.fixture +++ b/.php_cs.fixture @@ -13,7 +13,7 @@ declare(strict_types=1); use Ergebnis\PhpCsFixer; -$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php71(''), [ +$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php73(''), [ 'final_class' => false, ]); From 1dc38f261bf3c99c42fafe3709acd6c813020691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 3 Jan 2022 18:33:22 +0100 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' --- .php_cs | 4 +- src/DataProvider/StringProvider.php | 22 +-- src/Exception/InvalidExcludeClassName.php | 2 +- src/Exception/NonExistentDirectory.php | 2 +- src/Exception/NonExistentExcludeClass.php | 2 +- src/Helper.php | 40 ++-- .../DataProvider/AbstractProviderTestCase.php | 18 +- .../Exception/InvalidExcludeClassNameTest.php | 2 +- .../Exception/NonExistentDirectoryTest.php | 2 +- .../Exception/NonExistentExcludeClassTest.php | 2 +- test/Unit/HelperTest.php | 178 +++++++++--------- 11 files changed, 137 insertions(+), 137 deletions(-) diff --git a/.php_cs b/.php_cs index 15d538d..5275f2b 100644 --- a/.php_cs +++ b/.php_cs @@ -18,10 +18,10 @@ $license = License\Type\MIT::markdown( __DIR__ . '/LICENSE.md', License\Range::since( License\Year::fromString('2017'), - new \DateTimeZone('UTC') + new \DateTimeZone('UTC'), ), License\Holder::fromString('Andreas Möller'), - License\Url::fromString('https://github.com/ergebnis/test-util') + License\Url::fromString('https://github.com/ergebnis/test-util'), ); $license->save(); diff --git a/src/DataProvider/StringProvider.php b/src/DataProvider/StringProvider.php index bdefdd5..8d47a40 100644 --- a/src/DataProvider/StringProvider.php +++ b/src/DataProvider/StringProvider.php @@ -104,10 +104,10 @@ private static function values(): array \array_map(static function (string $key): string { return \sprintf( 'string-blank-%s', - $key + $key, ); }, \array_keys($whitespaceCharacters)), - $whitespaceCharacters + $whitespaceCharacters, ); $emptyValues = [ @@ -119,7 +119,7 @@ private static function values(): array \array_map(static function (string $key): string { return \sprintf( 'string-untrimmed-%s', - $key + $key, ); }, \array_keys($whitespaceCharacters)), \array_map(static function (string $whitespaceCharacter) use ($faker): string { @@ -127,15 +127,15 @@ private static function values(): array '%s%s%s', \str_repeat( $whitespaceCharacter, - $faker->numberBetween(1, 5) + $faker->numberBetween(1, 5), ), $faker->word(), \str_repeat( $whitespaceCharacter, - $faker->numberBetween(1, 5) - ) + $faker->numberBetween(1, 5), + ), ); - }, $whitespaceCharacters) + }, $whitespaceCharacters), ); /** @var array $withWhitespaceValues */ @@ -143,7 +143,7 @@ private static function values(): array \array_map(static function (string $key): string { return \sprintf( 'string-with-whitespace-%s', - $key + $key, ); }, \array_keys($whitespaceCharacters)), \array_map(static function (string $whitespaceCharacter) use ($faker): string { @@ -152,9 +152,9 @@ private static function values(): array return \implode( $whitespaceCharacter, - $words + $words, ); - }, $whitespaceCharacters) + }, $whitespaceCharacters), ); return \array_merge( @@ -162,7 +162,7 @@ private static function values(): array $blankValues, $emptyValues, $untrimmedValues, - $withWhitespaceValues + $withWhitespaceValues, ); } diff --git a/src/Exception/InvalidExcludeClassName.php b/src/Exception/InvalidExcludeClassName.php index f7d7c6c..71c37e5 100644 --- a/src/Exception/InvalidExcludeClassName.php +++ b/src/Exception/InvalidExcludeClassName.php @@ -25,7 +25,7 @@ public static function fromClassName($className): self { return new self(\sprintf( 'Exclude class name should be a string, got "%s" instead.', - \is_object($className) ? \get_class($className) : \gettype($className) + \is_object($className) ? \get_class($className) : \gettype($className), )); } } diff --git a/src/Exception/NonExistentDirectory.php b/src/Exception/NonExistentDirectory.php index e7e3640..b439816 100644 --- a/src/Exception/NonExistentDirectory.php +++ b/src/Exception/NonExistentDirectory.php @@ -22,7 +22,7 @@ public static function fromDirectory(string $directory): self { return new self(\sprintf( 'Directory "%s" does not exist.', - $directory + $directory, )); } } diff --git a/src/Exception/NonExistentExcludeClass.php b/src/Exception/NonExistentExcludeClass.php index 98f17c6..b1e7f25 100644 --- a/src/Exception/NonExistentExcludeClass.php +++ b/src/Exception/NonExistentExcludeClass.php @@ -22,7 +22,7 @@ public static function fromClassName(string $className): self { return new self(\sprintf( 'Exclude class "%s" does not exist.', - $className + $className, )); } } diff --git a/src/Helper.php b/src/Helper.php index 0477d54..5fcfcd4 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -75,7 +75,7 @@ static function (string $className): bool { }, $directory, $excludeClassNames, - "Failed asserting that the classes\n\n%s\n\nare abstract or final." + "Failed asserting that the classes\n\n%s\n\nare abstract or final.", ); } @@ -115,7 +115,7 @@ final protected static function assertClassesHaveTests(string $directory, string \array_map(static function (Classy\Construct $construct): string { return $construct->name(); }, $constructs), - $excludeClassyNames + $excludeClassyNames, ); $namespace = \rtrim($namespace, '\\') . '\\'; @@ -125,7 +125,7 @@ final protected static function assertClassesHaveTests(string $directory, string return \str_replace( $namespace, $testNamespace, - $className + $className, ) . 'Test'; }; @@ -166,16 +166,16 @@ final protected static function assertClassesHaveTests(string $directory, string \implode("\n", \array_map(static function (string $className): string { return \sprintf( ' - %s', - $className + $className, ); }, $classesWithoutTests)), \implode("\n", \array_map(static function (string $className) use ($testClassNameFrom): string { return \sprintf( ' - %s', - $testClassNameFrom($className) + $testClassNameFrom($className), ); }, $classesWithoutTests)), - Framework\TestCase::class + Framework\TestCase::class, )); } @@ -217,7 +217,7 @@ final protected static function assertClassyConstructsSatisfySpecification(calla $classyNames = \array_diff( $constructs, - $excludeClassyNames + $excludeClassyNames, ); $classyNamesNotSatisfyingSpecification = \array_filter($classyNames, static function (string $className) use ($specification): bool { @@ -226,7 +226,7 @@ final protected static function assertClassyConstructsSatisfySpecification(calla self::assertEmpty($classyNamesNotSatisfyingSpecification, \sprintf( '' !== $message ? $message : "Failed asserting that the classy constructs\n\n%s\n\nsatisfy a specification.", - ' - ' . \implode("\n - ", $classyNamesNotSatisfyingSpecification) + ' - ' . \implode("\n - ", $classyNamesNotSatisfyingSpecification), )); } @@ -237,7 +237,7 @@ final protected static function assertClassExists(string $className): void { self::assertTrue(\class_exists($className), \sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); } @@ -261,7 +261,7 @@ final protected static function assertClassExtends(string $parentClassName, stri self::assertTrue($reflection->isSubclassOf($parentClassName), \sprintf( 'Failed asserting that class "%s" extends "%s".', $className, - $parentClassName + $parentClassName, )); } @@ -285,7 +285,7 @@ final protected static function assertClassImplementsInterface(string $interface self::assertTrue($reflection->implementsInterface($interfaceName), \sprintf( 'Failed asserting that class "%s" implements interface "%s".', $className, - $interfaceName + $interfaceName, )); } @@ -305,7 +305,7 @@ final protected static function assertClassIsAbstract(string $className): void self::assertTrue($reflection->isAbstract(), \sprintf( 'Failed asserting that class "%s" is abstract.', - $className + $className, )); } @@ -327,7 +327,7 @@ final protected static function assertClassIsFinal(string $className): void self::assertTrue($reflection->isFinal(), \sprintf( 'Failed asserting that class "%s" is final.', - $className + $className, )); } @@ -347,7 +347,7 @@ final protected static function assertClassSatisfiesSpecification(callable $spec self::assertTrue($specification($className), \sprintf( '' !== $message ? $message : 'Failed asserting that class "%s" satisfies a specification.', - $className + $className, )); } @@ -368,7 +368,7 @@ final protected static function assertClassUsesTrait(string $traitName, string $ self::assertContains($traitName, \class_uses($className), \sprintf( 'Failed asserting that class "%s" uses trait "%s".', $className, - $traitName + $traitName, )); } @@ -379,7 +379,7 @@ final protected static function assertInterfaceExists(string $interfaceName): vo { self::assertTrue(\interface_exists($interfaceName), \sprintf( 'Failed asserting that an interface "%s" exists.', - $interfaceName + $interfaceName, )); } @@ -403,7 +403,7 @@ final protected static function assertInterfaceExtends(string $parentInterfaceNa self::assertTrue($reflection->isSubclassOf($parentInterfaceName), \sprintf( 'Failed asserting that interface "%s" extends "%s".', $interfaceName, - $parentInterfaceName + $parentInterfaceName, )); } @@ -423,7 +423,7 @@ final protected static function assertInterfaceSatisfiesSpecification(callable $ self::assertTrue($specification($interfaceName), \sprintf( '' !== $message ? $message : 'Failed asserting that interface "%s" satisfies a specification.', - $interfaceName + $interfaceName, )); } @@ -434,7 +434,7 @@ final protected static function assertTraitExists(string $traitName): void { self::assertTrue(\trait_exists($traitName), \sprintf( 'Failed asserting that a trait "%s" exists.', - $traitName + $traitName, )); } @@ -454,7 +454,7 @@ final protected static function assertTraitSatisfiesSpecification(callable $spec self::assertTrue($specification($traitName), \sprintf( '' !== $message ? $message : 'Failed asserting that trait "%s" satisfies a specification.', - $traitName + $traitName, )); } diff --git a/test/Unit/DataProvider/AbstractProviderTestCase.php b/test/Unit/DataProvider/AbstractProviderTestCase.php index 7035ae7..019da3c 100644 --- a/test/Unit/DataProvider/AbstractProviderTestCase.php +++ b/test/Unit/DataProvider/AbstractProviderTestCase.php @@ -39,7 +39,7 @@ final protected static function assertProvidesDataSetsForValues(array $values, \ self::assertEquals( $expectedDataSets, $actualDataSets, - 'Failed asserting that a generator yields data sets for the expected values.' + 'Failed asserting that a generator yields data sets for the expected values.', ); } @@ -53,7 +53,7 @@ final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifi 'string', \array_keys($specifications), true, - 'Failed asserting that the keys of specifications are all strings.' + 'Failed asserting that the keys of specifications are all strings.', ); self::assertContainsOnly( @@ -62,8 +62,8 @@ final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifi false, \sprintf( 'Failed asserting that the values of specifications implement "%s".', - Util\Test\Util\DataProvider\Specification\Specification::class - ) + Util\Test\Util\DataProvider\Specification\Specification::class, + ), ); $dataSets = \iterator_to_array($provider); @@ -71,7 +71,7 @@ final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifi self::assertEquals( \array_keys($specifications), \array_keys($dataSets), - 'Failed asserting that the provided data has the same keys as the specifications.' + 'Failed asserting that the provided data has the same keys as the specifications.', ); $keysForDataSetsWhereValueDoesNotSatisfySpecification = \array_filter(\array_keys($dataSets), static function (string $key) use ($dataSets, $specifications): bool { @@ -82,12 +82,12 @@ final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifi self::assertIsArray($dataSet, \sprintf( 'Failed asserting that the data set provided for key "%s" is an array.', - $key + $key, )); self::assertCount(1, $dataSet, \sprintf( 'Failed asserting that the data set provided for key "%s" contains only one value.', - $key + $key, )); $value = \array_shift($dataSet); @@ -99,8 +99,8 @@ final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifi 'Failed asserting that the value for the data sets with the keys "%s" satisfy the corresponding requirements.', \implode( '", "', - $keysForDataSetsWhereValueDoesNotSatisfySpecification - ) + $keysForDataSetsWhereValueDoesNotSatisfySpecification, + ), )); } diff --git a/test/Unit/Exception/InvalidExcludeClassNameTest.php b/test/Unit/Exception/InvalidExcludeClassNameTest.php index bb1430e..4c24924 100644 --- a/test/Unit/Exception/InvalidExcludeClassNameTest.php +++ b/test/Unit/Exception/InvalidExcludeClassNameTest.php @@ -46,7 +46,7 @@ public function testFromClassNameReturnsException($className): void $message = \sprintf( 'Exclude class name should be a string, got "%s" instead.', - \is_object($className) ? \get_class($className) : \gettype($className) + \is_object($className) ? \get_class($className) : \gettype($className), ); self::assertSame($message, $exception->getMessage()); diff --git a/test/Unit/Exception/NonExistentDirectoryTest.php b/test/Unit/Exception/NonExistentDirectoryTest.php index bbdfe62..4514fd8 100644 --- a/test/Unit/Exception/NonExistentDirectoryTest.php +++ b/test/Unit/Exception/NonExistentDirectoryTest.php @@ -43,7 +43,7 @@ public function testFromDirectoryReturnsException(): void $message = \sprintf( 'Directory "%s" does not exist.', - $directory + $directory, ); self::assertSame($message, $exception->getMessage()); diff --git a/test/Unit/Exception/NonExistentExcludeClassTest.php b/test/Unit/Exception/NonExistentExcludeClassTest.php index df08479..ccbe6f0 100644 --- a/test/Unit/Exception/NonExistentExcludeClassTest.php +++ b/test/Unit/Exception/NonExistentExcludeClassTest.php @@ -43,7 +43,7 @@ public function testFromClassNameReturnsException(): void $message = \sprintf( 'Exclude class "%s" does not exist.', - $className + $className, ); self::assertSame($message, $exception->getMessage()); diff --git a/test/Unit/HelperTest.php b/test/Unit/HelperTest.php index f8fb877..1f64a62 100644 --- a/test/Unit/HelperTest.php +++ b/test/Unit/HelperTest.php @@ -54,9 +54,9 @@ public function testHelperMethodsAreFinalProtectedAndStatic(): void return \sprintf( ' - %s::%s()', $className, - $method->getName() + $method->getName(), ); - }, $methodsNeitherFinalNorProtected)) + }, $methodsNeitherFinalNorProtected)), )); } @@ -133,7 +133,7 @@ public function testAssertClassesAreAbstractOrFinalFailsWhenFoundClassesAreNeith $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( "Failed asserting that the classes\n\n%s\n\nare abstract or final.", - ' - ' . \implode("\n - ", $classesNeitherAbstractNorFinal) + ' - ' . \implode("\n - ", $classesNeitherAbstractNorFinal), )); self::assertClassesAreAbstractOrFinal($directory); @@ -169,7 +169,7 @@ public function testAssertClassesAreAbstractOrFinalWithExcludeClassNamesRejectsI self::assertClassesAreAbstractOrFinal( $directory, - $excludeClassNames + $excludeClassNames, ); } @@ -214,7 +214,7 @@ public function testAssertClassesAreAbstractOrFinalWithExcludeClassNamesRejectsN self::assertClassesAreAbstractOrFinal( $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -232,12 +232,12 @@ public function testAssertClassesAreAbstractOrFinalWithExcludeClassNamesFailsWhe $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( "Failed asserting that the classes\n\n%s\n\nare abstract or final.", - ' - ' . \implode("\n - ", $classesNeitherAbstractNorFinal) + ' - ' . \implode("\n - ", $classesNeitherAbstractNorFinal), )); self::assertClassesAreAbstractOrFinal( $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -251,7 +251,7 @@ public function testAssertClassesAreAbstractOrFinalWithExcludeClassNamesSucceeds self::assertClassesAreAbstractOrFinal( $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -266,7 +266,7 @@ public function testAssertClassesHaveTestsRejectsNonExistentDirectory(): void self::assertClassesHaveTests( $directory, $namespace, - $testNamespace + $testNamespace, ); } @@ -289,28 +289,28 @@ public function testAssertClassesHaveTestsFailsWhenFoundClassesDoNotHaveTests(): \implode("\n", \array_map(static function (string $className): string { return \sprintf( ' - %s', - $className + $className, ); }, $classesWithoutTests)), \implode("\n", \array_map(static function (string $className) use ($namespace, $testNamespace): string { $testClassName = \str_replace( $namespace, $testNamespace, - $className + $className, ) . 'Test'; return \sprintf( ' - %s', - $testClassName + $testClassName, ); }, $classesWithoutTests)), - Framework\TestCase::class + Framework\TestCase::class, )); self::assertClassesHaveTests( $directory, $namespace, - $testNamespace + $testNamespace, ); } @@ -323,7 +323,7 @@ public function testAssertClassesHaveTestsSucceedsWhenNoClassesHaveBeenFound(): self::assertClassesHaveTests( $directory, $namespace, - $testNamespace + $testNamespace, ); } @@ -336,7 +336,7 @@ public function testAssertClassesHaveTestsSucceedsWhenFoundClassesHaveTests(): v self::assertClassesHaveTests( $directory, $namespace, - $testNamespace + $testNamespace, ); } @@ -350,7 +350,7 @@ public function testAssertClassesHaveTestsWorksWithAndWithoutTrailingSlash(strin self::assertClassesHaveTests( $directory, $namespace, - $testNamespace + $testNamespace, ); } @@ -399,7 +399,7 @@ public function testAssertClassesHaveTestsWithExcludeClassNamesRejectsInvalidExc $directory, $namespace, $testNamespace, - $excludeClassyNames + $excludeClassyNames, ); } @@ -421,7 +421,7 @@ public function testAssertClassesHaveTestsWithExcludeClassNamesRejectsNonExisten $directory, $namespace, $testNamespace, - $excludeClassyNames + $excludeClassyNames, ); } @@ -441,14 +441,14 @@ public function testAssertClassesHaveTestsWithExcludeClassNamesFailsWhenFoundCla $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( "Failed asserting that the classes\n\n%s\n\nhave tests.", - ' - ' . \implode("\n - ", $classesWithoutTests) + ' - ' . \implode("\n - ", $classesWithoutTests), )); self::assertClassesHaveTests( $directory, $namespace, $testNamespace, - $excludeClassyNames + $excludeClassyNames, ); } @@ -466,7 +466,7 @@ public function testAssertClassesHaveTestsWithExcludeClassNamesSucceedsWhenFound $directory, $namespace, $testNamespace, - $excludeClassyNames + $excludeClassyNames, ); } @@ -480,7 +480,7 @@ public function testAssertClassyConstructsSatisfySpecificationRejectsNonExistent static function (string $classyName): bool { return false; }, - $directory + $directory, ); } @@ -495,14 +495,14 @@ public function testAssertClassyConstructsSatisfySpecificationFailsWhenFoundClas $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( "Failed asserting that the classy constructs\n\n%s\n\nsatisfy a specification.", - ' - ' . \implode("\n - ", $classesNotSatisfyingSpecification) + ' - ' . \implode("\n - ", $classesNotSatisfyingSpecification), )); self::assertClassyConstructsSatisfySpecification( static function (string $className): bool { return false; }, - $directory + $directory, ); } @@ -514,7 +514,7 @@ public function testAssertClassyConstructsSatisfySpecificationSucceedsWhenNoClas static function (string $className): bool { return false; }, - $directory + $directory, ); } @@ -526,7 +526,7 @@ public function testAssertClassyConstructsSatisfySpecificationSucceedsWhenFoundC static function (string $className): bool { return true; }, - $directory + $directory, ); } @@ -549,7 +549,7 @@ static function (): bool { return true; }, $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -569,7 +569,7 @@ static function (string $classyName): bool { return Fixture\ClassyConstructsSatisfySpecification\ExampleClass::class === $classyName; }, $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -587,7 +587,7 @@ public function testAssertClassyConstructsSatisfySpecificationWithExcludeClassyN $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( "Failed asserting that the classy constructs\n\n%s\n\nsatisfy a specification.", - ' - ' . \implode("\n - ", $classesNotSatisfyingSpecification) + ' - ' . \implode("\n - ", $classesNotSatisfyingSpecification), )); self::assertClassyConstructsSatisfySpecification( @@ -595,7 +595,7 @@ static function (string $classyName): bool { return false; }, $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -611,7 +611,7 @@ static function (string $classyName): bool { return Fixture\ClassyConstructsSatisfySpecification\ExampleClass::class === $classyName; }, $directory, - $excludeClassyNames + $excludeClassyNames, ); } @@ -623,7 +623,7 @@ public function testAssertClassExistsFailsWhenClassIsNotClass(string $className) $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassExists($className); @@ -664,12 +664,12 @@ public function testAssertClassExtendsFailsWhenParentClassIsNotClass(string $par $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $parentClassName + $parentClassName, )); self::assertClassExtends( $parentClassName, - $className + $className, ); } @@ -683,12 +683,12 @@ public function testAssertClassExtendsFailsWhenClassIsNotClass(string $className $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassExtends( $parentClassName, - $className + $className, ); } @@ -701,12 +701,12 @@ public function testClassExtendsFailsWhenClassDoesNotExtendParentClass(): void $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" extends "%s".', $className, - $parentClassName + $parentClassName, )); self::assertClassExtends( $parentClassName, - $className + $className, ); } @@ -717,7 +717,7 @@ public function testAssertClassExtendsSucceedsWhenClassExtendsParentClass(): voi self::assertClassExtends( $parentClassName, - $className + $className, ); } @@ -731,12 +731,12 @@ public function testAssertClassImplementsInterfaceFailsWhenInterfaceIsNotInterfa $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that an interface "%s" exists.', - $interfaceName + $interfaceName, )); self::assertClassImplementsInterface( $interfaceName, - $className + $className, ); } @@ -750,12 +750,12 @@ public function testAssertClassImplementsInterfaceFailsWhenClassIsNotClass(strin $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassImplementsInterface( $interfaceName, - $className + $className, ); } @@ -768,12 +768,12 @@ public function testAssertClassImplementsInterfaceFailsWhenClassDoesNotImplement $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" implements interface "%s".', $className, - $interfaceName + $interfaceName, )); self::assertClassImplementsInterface( $interfaceName, - $className + $className, ); } @@ -784,7 +784,7 @@ public function testAssertClassImplementsInterfaceSucceedsWhenClassImplementsInt self::assertClassImplementsInterface( $interfaceName, - $className + $className, ); } @@ -796,7 +796,7 @@ public function testAssertClassIsAbstractFailsWhenClassIsNotClass(string $classN $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassIsAbstract($className); @@ -809,7 +809,7 @@ public function testAssertClassIsAbstractFailsWhenClassIsNotAbstract(): void $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" is abstract.', - $className + $className, )); self::assertClassIsAbstract($className); @@ -830,7 +830,7 @@ public function testAssertClassIsFinalFailsWhenClassIsNotClass(string $className $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassIsFinal($className); @@ -843,7 +843,7 @@ public function testAssertClassIsFinalFailsWhenClassIsNotFinal(): void $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" is final.', - $className + $className, )); self::assertClassIsFinal($className); @@ -864,14 +864,14 @@ public function testAssertClassSatisfiesSpecificationFailsWhenClassIsNotAClass(s $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassSatisfiesSpecification( static function (): bool { return true; }, - $className + $className, ); } @@ -882,14 +882,14 @@ public function testAssertClassSatisfiesSpecificationFailsWhenSpecificationRetur $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" satisfies a specification.', - $className + $className, )); self::assertClassSatisfiesSpecification( static function (): bool { return false; }, - $className + $className, ); } @@ -901,7 +901,7 @@ public function testAssertClassSatisfiesSpecificationFailsWhenSpecificationRetur $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( $message, - $className + $className, )); self::assertClassSatisfiesSpecification( @@ -909,7 +909,7 @@ static function (): bool { return false; }, $className, - $message + $message, ); } @@ -921,7 +921,7 @@ public function testAssertClassSatisfiesSpecificationSucceedsWhenSpecificationRe static function (): bool { return true; }, - $className + $className, ); } @@ -935,12 +935,12 @@ public function testAssertClassUsesTraitFailsWhenTraitIsNotTrait(string $traitNa $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a trait "%s" exists.', - $traitName + $traitName, )); self::assertClassUsesTrait( $traitName, - $className + $className, ); } @@ -954,12 +954,12 @@ public function testAssertClassUsesTraitFailsWhenClassIsNotClass(string $classNa $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a class "%s" exists.', - $className + $className, )); self::assertClassUsesTrait( $traitName, - $className + $className, ); } @@ -972,12 +972,12 @@ public function testAssertClassUsesTraitFailsWhenClassDoesNotUseTrait(): void $this->expectExceptionMessage(\sprintf( 'Failed asserting that class "%s" uses trait "%s".', $className, - $traitName + $traitName, )); self::assertClassUsesTrait( $traitName, - $className + $className, ); } @@ -988,7 +988,7 @@ public function testAssertClassUsesTraitSucceedsWhenClassUsesTrait(): void self::assertClassUsesTrait( $traitName, - $className + $className, ); } @@ -1000,7 +1000,7 @@ public function testAssertInterfaceExistsFailsWhenInterfaceIsNotInterface(string $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that an interface "%s" exists.', - $interfaceName + $interfaceName, )); self::assertInterfaceExists($interfaceName); @@ -1041,12 +1041,12 @@ public function testInterfaceExtendsFailsWhenParentInterfaceIsNotInterface(strin $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that an interface "%s" exists.', - $parentInterfaceName + $parentInterfaceName, )); self::assertInterfaceExtends( $parentInterfaceName, - $interfaceName + $interfaceName, ); } @@ -1060,12 +1060,12 @@ public function testAssertInterfaceExtendsFailsWhenInterfaceIsNotInterface(strin $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that an interface "%s" exists.', - $interfaceName + $interfaceName, )); self::assertInterfaceExtends( $parentInterfaceName, - $interfaceName + $interfaceName, ); } @@ -1078,12 +1078,12 @@ public function testAssertInterfaceExtendsFailsWhenInterfaceDoesNotExtendParentI $this->expectExceptionMessage(\sprintf( 'Failed asserting that interface "%s" extends "%s".', $interfaceName, - $parentInterfaceName + $parentInterfaceName, )); self::assertInterfaceExtends( $parentInterfaceName, - $interfaceName + $interfaceName, ); } @@ -1094,7 +1094,7 @@ public function testAssertInterfaceExtendsSucceedsWhenInterfaceExtendsParentInte self::assertInterfaceExtends( $parentInterfaceName, - $interfaceName + $interfaceName, ); } @@ -1106,14 +1106,14 @@ public function testAssertInterfaceSatisfiesSpecificationFailsWhenInterfaceIsNot $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that an interface "%s" exists.', - $interfaceName + $interfaceName, )); self::assertInterfaceSatisfiesSpecification( static function (): bool { return true; }, - $interfaceName + $interfaceName, ); } @@ -1124,14 +1124,14 @@ public function testAssertInterfaceSatisfiesSpecificationFailsWhenSpecificationR $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that interface "%s" satisfies a specification.', - $interfaceName + $interfaceName, )); self::assertInterfaceSatisfiesSpecification( static function (): bool { return false; }, - $interfaceName + $interfaceName, ); } @@ -1143,7 +1143,7 @@ public function testAssertInterfaceSatisfiesSpecificationFailsWhenSpecificationR $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( $message, - $interfaceName + $interfaceName, )); self::assertInterfaceSatisfiesSpecification( @@ -1151,7 +1151,7 @@ static function (): bool { return false; }, $interfaceName, - $message + $message, ); } @@ -1163,7 +1163,7 @@ public function testAssertInterfaceSatisfiesSpecificationSucceedsWhenSpecificati static function (): bool { return true; }, - $interfaceName + $interfaceName, ); } @@ -1175,7 +1175,7 @@ public function testAssertTraitExistsFailsWhenTraitIsNotTrait(string $traitName) $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a trait "%s" exists.', - $traitName + $traitName, )); self::assertTraitExists($traitName); @@ -1214,14 +1214,14 @@ public function testAssertTraitSatisfiesSpecificationFailsWhenTraitIsNotATrait(s $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that a trait "%s" exists.', - $traitName + $traitName, )); self::assertTraitSatisfiesSpecification( static function (): bool { return true; }, - $traitName + $traitName, ); } @@ -1232,14 +1232,14 @@ public function testAssertTraitSatisfiesSpecificationFailsWhenSpecificationRetur $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( 'Failed asserting that trait "%s" satisfies a specification.', - $traitName + $traitName, )); self::assertTraitSatisfiesSpecification( static function (): bool { return false; }, - $traitName + $traitName, ); } @@ -1251,7 +1251,7 @@ public function testAssertTraitSatisfiesSpecificationFailsWhenSpecificationRetur $this->expectException(Framework\AssertionFailedError::class); $this->expectExceptionMessage(\sprintf( $message, - $traitName + $traitName, )); self::assertTraitSatisfiesSpecification( @@ -1259,7 +1259,7 @@ static function (): bool { return false; }, $traitName, - $message + $message, ); } @@ -1271,7 +1271,7 @@ public function testAssertTraitSatisfiesSpecificationSucceedsWhenSpecificationRe static function (): bool { return true; }, - $traitName + $traitName, ); } @@ -1441,7 +1441,7 @@ static function (array $providerLocales, string $providerClass): array { return $providerLocales; }, - [] + [], ); $locales = \array_values(\array_unique($providerLocales));