diff --git a/composer.json b/composer.json index 64a9472..dcbd093 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6 || ^10.0" + "phpunit/phpunit": "^9.6" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/tests/Feature/ConfigTest.php b/tests/Feature/ConfigTest.php index b4f340e..c7c0fbf 100644 --- a/tests/Feature/ConfigTest.php +++ b/tests/Feature/ConfigTest.php @@ -13,10 +13,9 @@ class ConfigTest extends TestCase /** * The input of rule set is valid * - * @test * @dataProvider validRuleSetInputProvider */ - public function validRuleSetInput($ruleSet): void + public function testValidRuleSetInput($ruleSet): void { $this->assertInstanceOf( \PhpCsFixer\ConfigInterface::class, @@ -27,10 +26,9 @@ public function validRuleSetInput($ruleSet): void /** * The input of rule set is invalid * - * @test * @dataProvider invalidRuleSetInputProvider */ - public function invalidRuleSetInput($ruleSet, $expectException): void + public function testInvalidRuleSetInput($ruleSet, $expectException): void { $this->expectException($expectException); @@ -42,10 +40,8 @@ public function invalidRuleSetInput($ruleSet, $expectException): void /** * User dapat menambahkan/menonaktifkan rules - * - * @test */ - public function userCanAddLocalRules(): void + public function testUserCanAddLocalRules(): void { $rules1 = Config::create(new RuleSetFile)->getRules(); $rules2 = ['foo' => 'bar']; @@ -59,10 +55,8 @@ public function userCanAddLocalRules(): void /** * Nama aturan ketika user menambahkan aturan lokal - * - * @test */ - public function theNameOfTheRuleWhenTheUserAddsALocalRule(): void + public function testTheNameOfTheRuleWhenTheUserAddsALocalRule(): void { $this->assertSame( '@RuleSetFile (1 rules)', diff --git a/tests/Unit/FinderTest.php b/tests/Unit/FinderTest.php index 6672451..e34866b 100644 --- a/tests/Unit/FinderTest.php +++ b/tests/Unit/FinderTest.php @@ -10,10 +10,8 @@ class FinderTest extends TestCase { /** * It returns a PHP CS Fixer finder object - * - * @test */ - public function baseFinderMustReturnsAPhpCsFinderObject(): void + public function testBaseFinderMustReturnsAPhpCsFinderObject(): void { $finder = Finder::base(__DIR__); @@ -22,10 +20,8 @@ public function baseFinderMustReturnsAPhpCsFinderObject(): void /** * It returns a PHP CS Fixer finder object - * - * @test */ - public function laravelFinderMustReturnsAPhpCsFinderObject(): void + public function testLaravelFinderMustReturnsAPhpCsFinderObject(): void { $finder = Finder::laravel(__DIR__.'/../..'); diff --git a/tests/Unit/RuleSetTest.php b/tests/Unit/RuleSetTest.php index e9d3f00..5399ab0 100644 --- a/tests/Unit/RuleSetTest.php +++ b/tests/Unit/RuleSetTest.php @@ -16,10 +16,8 @@ protected function getClassShortName($ruleSet): string /** * It implements only interface methods - * - * @test */ - public function itImplementsOnlyInterfaceMethods(): void + public function testItImplementsOnlyInterfaceMethods(): void { $reflect = new \ReflectionClass(new RuleSetFile); $this->assertCount(1, $reflect->getMethods(\ReflectionMethod::IS_PROTECTED)); @@ -28,10 +26,8 @@ public function itImplementsOnlyInterfaceMethods(): void /** * Nama yang dikembalikan haruslah string yang diimput itu sendiri. - * - * @test */ - public function ruleSetNameWithStringInput(): void + public function testRuleSetNameWithStringInput(): void { $actual = Config::create('@Realodix')->getName(); @@ -40,10 +36,8 @@ public function ruleSetNameWithStringInput(): void /** * Nama yang dikembalikan haruslah nama kelas itu sendiri dengan awalan `@`. - * - * @test */ - public function ruleSetName(): void + public function testRuleSetName(): void { $expected = '@'.$this->getClassShortName(new RuleSetFile); $actual = (new RuleSetFile)->getName(); @@ -54,10 +48,8 @@ public function ruleSetName(): void /** * Nama yang dikembalikan haruslah nama yang telah ditetapkan di dalam kelas * tersebut. - * - * @test */ - public function ruleSetNameWithoutSetName(): void + public function testRuleSetNameWithoutSetName(): void { $expected = (new RuleSetWithSetNameFile)->name; $actual = (new RuleSetWithSetNameFile)->getName(); @@ -67,10 +59,8 @@ public function ruleSetNameWithoutSetName(): void /** * Nama yang dikembalikan haruslah nama yang telah ditetapkan oleh Relax. - * - * @test */ - public function nameReturnedByLocalRule(): void + public function testNameReturnedByLocalRule(): void { $actual = Config::create([])->getName(); diff --git a/tests/Unit/UtilsTest.php b/tests/Unit/UtilsTest.php index ece73cf..a3acad8 100644 --- a/tests/Unit/UtilsTest.php +++ b/tests/Unit/UtilsTest.php @@ -8,10 +8,9 @@ class UtilsTest extends TestCase { /** - * @test * @dataProvider pcsfRuleSetClassExistsProvider */ - public function pcsfRuleSetClassExists($ruleSetName): void + public function testPcsfRuleSetClassExists($ruleSetName): void { $class = Utils::pcsfRuleSetClass($ruleSetName); @@ -31,10 +30,9 @@ public static function pcsfRuleSetClassExistsProvider() } /** - * @test * @dataProvider pcsfRuleSetNameToClassNameProvider */ - public function pcsfRuleSetNameToClassName($actual, $expected): void + public function testPcsfRuleSetNameToClassName($actual, $expected): void { $className = Utils::pcsfRuleSetNameToClassName($actual); diff --git a/tests/Unit/ValidRulesTest.php b/tests/Unit/ValidRulesTest.php index 160e174..c6c4186 100644 --- a/tests/Unit/ValidRulesTest.php +++ b/tests/Unit/ValidRulesTest.php @@ -11,10 +11,8 @@ class ValidRulesTest extends TestCase { /** * @Realodix set returns a valid PhpCsFIxer rules. - * - * @test */ - public function realodixReturnsAValidPhpCsFIxerRules(): void + public function testRealodixReturnsAValidPhpCsFIxerRules(): void { $rules = $this->getCleanedRules(new \Realodix\Relax\RuleSet\Sets\Realodix); $factory = (new FixerFactory) @@ -26,10 +24,8 @@ public function realodixReturnsAValidPhpCsFIxerRules(): void /** * @RealodixPlus set returns a valid PhpCsFIxer rules. - * - * @test */ - public function realodixPlusReturnsAValidPhpCsFIxerRules(): void + public function testRealodixPlusReturnsAValidPhpCsFIxerRules(): void { $rules = $this->getCleanedRules(new \Realodix\Relax\RuleSet\Sets\RealodixPlus); $factory = (new FixerFactory)