Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 5077179

Browse files
author
danielbannert
committed
changed php_unit_test_case_static_method_calls from static to this
1 parent f661aa5 commit 5077179

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"pedrotroller/php-cs-custom-fixer": "^2.15.2"
2626
},
2727
"require-dev": {
28-
"phpstan/phpstan": "^0.10.3",
29-
"phpstan/phpstan-deprecation-rules": "^0.10.3",
30-
"phpstan/phpstan-phpunit": "^0.10.3",
31-
"phpstan/phpstan-strict-rules": "^0.10.3",
28+
"phpstan/phpstan": "^0.10.5",
29+
"phpstan/phpstan-deprecation-rules": "^0.10.5",
30+
"phpstan/phpstan-phpunit": "^0.10.5",
31+
"phpstan/phpstan-strict-rules": "^0.10.5",
3232
"phpunit/phpunit": "^7.2.0"
3333
},
3434
"config": {

src/Config.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ public function getRules(): array
7070
'noise_remaining_usages' => false,
7171
],
7272
'no_superfluous_phpdoc_tags' => false,
73-
'php_unit_test_case_static_method_calls' => [
74-
'call_type' => 'static',
75-
],
76-
'fopen_flags' => false,
77-
'fopen_flag_order' => false,
73+
'fopen_flags' => false,
74+
'fopen_flag_order' => false,
7875
];
7976

8077
$pedroTrollerRules = [

tests/ConfigTest.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ final class ConfigTest extends TestCase
1717
{
1818
public function testImplementsInterface(): void
1919
{
20-
static::assertInstanceOf(ConfigInterface::class, new Config());
20+
$this->assertInstanceOf(ConfigInterface::class, new Config());
2121
}
2222

2323
public function testValues(): void
2424
{
2525
$config = new Config();
2626

27-
static::assertSame('narrowspark', $config->getName());
27+
$this->assertSame('narrowspark', $config->getName());
2828
}
2929

3030
public function testHasPsr2Rules(): void
@@ -67,20 +67,20 @@ public function testIfAllRulesAreTested(): void
6767
$rules = (new Config())->getRules();
6868

6969
foreach ($rules as $key => $value) {
70-
static::assertTrue(isset($testRules[$key]), '[' . $key . '] Rule is missing.');
70+
$this->assertTrue(isset($testRules[$key]), '[' . $key . '] Rule is missing.');
7171
}
7272

73-
static::assertCount(\count($testRules), $rules);
73+
$this->assertCount(\count($testRules), $rules);
7474
}
7575

7676
public function testDoesNotHaveHeaderCommentFixerByDefault(): void
7777
{
7878
$rules = (new Config())->getRules();
7979

80-
static::assertArrayHasKey('header_comment', $rules);
81-
static::assertFalse($rules['header_comment']);
82-
static::assertTrue($rules['no_blank_lines_before_namespace']);
83-
static::assertFalse($rules['single_blank_line_before_namespace']);
80+
$this->assertArrayHasKey('header_comment', $rules);
81+
$this->assertFalse($rules['header_comment']);
82+
$this->assertTrue($rules['no_blank_lines_before_namespace']);
83+
$this->assertFalse($rules['single_blank_line_before_namespace']);
8484
}
8585

8686
public function testHasHeaderCommentFixerIfProvided(): void
@@ -89,17 +89,17 @@ public function testHasHeaderCommentFixerIfProvided(): void
8989
$config = new Config($header);
9090
$rules = $config->getRules();
9191

92-
static::assertArrayHasKey('header_comment', $rules);
92+
$this->assertArrayHasKey('header_comment', $rules);
9393

9494
$expected = [
9595
'comment_type' => 'PHPDoc',
9696
'header' => $header,
9797
'location' => 'after_declare_strict',
9898
'separate' => 'both',
9999
];
100-
static::assertSame($expected, $rules['header_comment']);
101-
static::assertTrue($rules['no_blank_lines_before_namespace']);
102-
static::assertFalse($rules['single_blank_line_before_namespace']);
100+
$this->assertSame($expected, $rules['header_comment']);
101+
$this->assertTrue($rules['no_blank_lines_before_namespace']);
102+
$this->assertFalse($rules['single_blank_line_before_namespace']);
103103
}
104104

105105
public function testAllConfiguredRulesAreBuiltIn(): void
@@ -119,7 +119,7 @@ public function testAllConfiguredRulesAreBuiltIn(): void
119119
\array_merge($this->builtInFixers(), $pedroTrollerRules)
120120
);
121121

122-
static::assertEmpty($fixersNotBuiltIn, \sprintf(
122+
$this->assertEmpty($fixersNotBuiltIn, \sprintf(
123123
'Failed to assert that fixers for the rules "%s" are built in',
124124
\implode('", "', $fixersNotBuiltIn)
125125
));
@@ -139,13 +139,13 @@ public function testDoesNotHaveRulesEnabled(string $fixer, $reason): void
139139
];
140140

141141
if ($fixer === 'array_syntax') {
142-
static::assertNotSame(['syntax' => 'long'], $config->getRules()['array_syntax'], \sprintf(
142+
$this->assertNotSame(['syntax' => 'long'], $config->getRules()['array_syntax'], \sprintf(
143143
'Fixer "%s" should not be enabled, because "%s"',
144144
$fixer,
145145
$reason['long']
146146
));
147147
} else {
148-
static::assertArraySubset($rule, $config->getRules(), true, \sprintf(
148+
$this->assertArraySubset($rule, $config->getRules(), true, \sprintf(
149149
'Fixer "%s" should not be enabled, because "%s"',
150150
$fixer,
151151
$reason
@@ -353,7 +353,7 @@ private function getPHPUnitRules(): array
353353
'use_class_const' => true,
354354
],
355355
'php_unit_test_case_static_method_calls' => [
356-
'call_type' => 'static',
356+
'call_type' => 'this',
357357
],
358358
'php_unit_internal_class' => [
359359
'types' => [
@@ -548,12 +548,12 @@ private function getSymfonyRules(): array
548548
private function assertHasRules(array $expected, array $actual, string $set): void
549549
{
550550
foreach ($expected as $fixer => $isEnabled) {
551-
static::assertArrayHasKey($fixer, $actual, \sprintf(
551+
$this->assertArrayHasKey($fixer, $actual, \sprintf(
552552
'Failed to assert that a rule for fixer "%s" (in set "%s") exists.,',
553553
$fixer,
554554
$set
555555
));
556-
static::assertSame($isEnabled, $actual[$fixer], \sprintf(
556+
$this->assertSame($isEnabled, $actual[$fixer], \sprintf(
557557
'Failed to assert that fixer "%s" (in set "%s") is %s.',
558558
$fixer,
559559
$set,

0 commit comments

Comments
 (0)