diff --git a/.travis.yml b/.travis.yml index 5218cd2..6a380ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ install: - $COMPOSER_UP jobs: + allow_failures: + - php: nightly + - php: 7.4snapshot + include: - stage: Test php: 7.1 @@ -31,6 +35,12 @@ jobs: - stage: Test php: 7.3 env: REMOVE_XDEBUG=true + - stage: Test + php: 7.4snapshot +# env: REMOVE_XDEBUG=true + - stage: Test + php: nightly +# env: REMOVE_XDEBUG=true - stage: Coding standard if: type != cron diff --git a/src/Config.php b/src/Config.php index 5ca5efe..0d4a7e8 100644 --- a/src/Config.php +++ b/src/Config.php @@ -95,9 +95,6 @@ public function getRules(): array 'noise_remaining_usages' => false, ], 'no_superfluous_phpdoc_tags' => false, - 'php_unit_test_case_static_method_calls' => [ - 'call_type' => 'this', - ], 'fopen_flags' => false, 'fopen_flag_order' => false, 'php_unit_test_class_requires_covers' => false, diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 737f032..ec64372 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -38,14 +38,14 @@ final class ConfigTest extends TestCase { public function testImplementsInterface(): void { - $this->assertInstanceOf(ConfigInterface::class, new Config()); + self::assertInstanceOf(ConfigInterface::class, new Config()); } public function testValues(): void { $config = new Config(); - $this->assertSame('narrowspark', $config->getName()); + self::assertSame('narrowspark', $config->getName()); } public function testHasPsr2Rules(): void @@ -90,20 +90,20 @@ public function testIfAllRulesAreTested(): void $rules = (new Config())->getRules(); foreach ($rules as $key => $value) { - $this->assertTrue(isset($testRules[$key]), '[' . $key . '] Rule is missing.'); + self::assertTrue(isset($testRules[$key]), '[' . $key . '] Rule is missing.'); } - $this->assertCount(\count($testRules), $rules); + self::assertCount(\count($testRules), $rules); } public function testDoesNotHaveHeaderCommentFixerByDefault(): void { $rules = (new Config())->getRules(); - $this->assertArrayHasKey('header_comment', $rules); - $this->assertFalse($rules['header_comment']); - $this->assertTrue($rules['no_blank_lines_before_namespace']); - $this->assertFalse($rules['single_blank_line_before_namespace']); + self::assertArrayHasKey('header_comment', $rules); + self::assertFalse($rules['header_comment']); + self::assertTrue($rules['no_blank_lines_before_namespace']); + self::assertFalse($rules['single_blank_line_before_namespace']); } public function testHasHeaderCommentFixerIfProvided(): void @@ -112,7 +112,7 @@ public function testHasHeaderCommentFixerIfProvided(): void $config = new Config($header); $rules = $config->getRules(); - $this->assertArrayHasKey('header_comment', $rules); + self::assertArrayHasKey('header_comment', $rules); $expected = [ 'comment_type' => 'PHPDoc', @@ -120,9 +120,9 @@ public function testHasHeaderCommentFixerIfProvided(): void 'location' => 'after_declare_strict', 'separate' => 'both', ]; - $this->assertSame($expected, $rules['header_comment']); - $this->assertTrue($rules['no_blank_lines_before_namespace']); - $this->assertFalse($rules['single_blank_line_before_namespace']); + self::assertSame($expected, $rules['header_comment']); + self::assertTrue($rules['no_blank_lines_before_namespace']); + self::assertFalse($rules['single_blank_line_before_namespace']); } public function testAllConfiguredRulesAreBuiltIn(): void @@ -148,7 +148,7 @@ public function testAllConfiguredRulesAreBuiltIn(): void \array_merge($this->builtInFixers(), $pedroTrollerRules, $kubawerlosRules) ); - $this->assertEmpty($fixersNotBuiltIn, \sprintf( + self::assertEmpty($fixersNotBuiltIn, \sprintf( 'Failed to assert that fixers for the rules "%s" are built in', \implode('", "', $fixersNotBuiltIn) )); @@ -168,13 +168,13 @@ public function testDoesNotHaveRulesEnabled(string $fixer, $reason): void ]; if ($fixer === 'array_syntax') { - $this->assertNotSame(['syntax' => 'long'], $config->getRules()['array_syntax'], \sprintf( + self::assertNotSame(['syntax' => 'long'], $config->getRules()['array_syntax'], \sprintf( 'Fixer "%s" should not be enabled, because "%s"', $fixer, $reason['long'] )); } else { - $this->assertArraySubset($rule, $config->getRules(), true, \sprintf( + self::assertArraySubset($rule, $config->getRules(), true, \sprintf( 'Fixer "%s" should not be enabled, because "%s"', $fixer, $reason @@ -426,7 +426,7 @@ private function getPHPUnitRules(): array 'use_class_const' => true, ], 'php_unit_test_case_static_method_calls' => [ - 'call_type' => 'this', + 'call_type' => 'self', ], 'php_unit_internal_class' => [ 'types' => [ @@ -629,12 +629,12 @@ private function getSymfonyRules(): array private function assertHasRules(array $expected, array $actual, string $set): void { foreach ($expected as $fixer => $isEnabled) { - $this->assertArrayHasKey($fixer, $actual, \sprintf( + self::assertArrayHasKey($fixer, $actual, \sprintf( 'Failed to assert that a rule for fixer "%s" (in set "%s") exists.,', $fixer, $set )); - $this->assertSame($isEnabled, $actual[$fixer], \sprintf( + self::assertSame($isEnabled, $actual[$fixer], \sprintf( 'Failed to assert that fixer "%s" (in set "%s") is %s.', $fixer, $set,