Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ install:
- $COMPOSER_UP

jobs:
allow_failures:
- php: nightly
- php: 7.4snapshot

include:
- stage: Test
php: 7.1
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
36 changes: 18 additions & 18 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -112,17 +112,17 @@ 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',
'header' => $header,
'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
Expand All @@ -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)
));
Expand All @@ -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
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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,
Expand Down