Skip to content

Commit a22ed83

Browse files
committed
Remove obsolete NoBleedingEdge tests
1 parent f13af95 commit a22ed83

5 files changed

+8
-302
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleNoBleedingEdgeTest.php

Lines changed: 0 additions & 61 deletions
This file was deleted.

tests/PHPStan/Rules/PhpDoc/InvalidPHPStanDocTagRuleTest.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,25 @@
66
use PHPStan\PhpDocParser\Parser\PhpDocParser;
77
use PHPStan\Rules\Rule;
88
use PHPStan\Testing\RuleTestCase;
9-
use function array_merge;
109

1110
/**
1211
* @extends RuleTestCase<InvalidPHPStanDocTagRule>
1312
*/
1413
class InvalidPHPStanDocTagRuleTest extends RuleTestCase
1514
{
1615

17-
private bool $checkAllInvalidPhpDocs;
18-
1916
protected function getRule(): Rule
2017
{
2118
return new InvalidPHPStanDocTagRule(
2219
self::getContainer()->getByType(Lexer::class),
2320
self::getContainer()->getByType(PhpDocParser::class),
24-
$this->checkAllInvalidPhpDocs,
21+
true,
2522
);
2623
}
2724

28-
public function dataRule(): iterable
25+
public function testRule(): void
2926
{
30-
$errors = [
27+
$this->analyse([__DIR__ . '/data/invalid-phpstan-doc.php'], [
3128
[
3229
'Unknown PHPDoc tag: @phpstan-extens',
3330
6,
@@ -44,29 +41,15 @@ public function dataRule(): iterable
4441
'Unknown PHPDoc tag: @phpstan-varr',
4542
46,
4643
],
47-
];
48-
yield [false, $errors];
49-
yield [true, array_merge($errors, [
5044
[
5145
'Unknown PHPDoc tag: @phpstan-varr',
5246
56,
5347
],
54-
])];
55-
}
56-
57-
/**
58-
* @dataProvider dataRule
59-
* @param list<array{0: string, 1: int, 2?: string}> $expectedErrors
60-
*/
61-
public function testRule(bool $checkAllInvalidPhpDocs, array $expectedErrors): void
62-
{
63-
$this->checkAllInvalidPhpDocs = $checkAllInvalidPhpDocs;
64-
$this->analyse([__DIR__ . '/data/invalid-phpstan-doc.php'], $expectedErrors);
48+
]);
6549
}
6650

6751
public function testBug8697(): void
6852
{
69-
$this->checkAllInvalidPhpDocs = true;
7053
$this->analyse([__DIR__ . '/data/bug-8697.php'], []);
7154
}
7255

tests/PHPStan/Rules/PhpDoc/InvalidPhpDocTagValueRuleNoBleedingEdgeTest.php

Lines changed: 0 additions & 146 deletions
This file was deleted.

tests/PHPStan/Rules/PhpDoc/InvalidPhpDocTagValueRuleTest.php

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,26 @@
66
use PHPStan\PhpDocParser\Parser\PhpDocParser;
77
use PHPStan\Rules\Rule;
88
use PHPStan\Testing\RuleTestCase;
9-
use function array_merge;
109

1110
/**
1211
* @extends RuleTestCase<InvalidPhpDocTagValueRule>
1312
*/
1413
class InvalidPhpDocTagValueRuleTest extends RuleTestCase
1514
{
1615

17-
private bool $checkAllInvalidPhpDocs;
18-
1916
protected function getRule(): Rule
2017
{
2118
return new InvalidPhpDocTagValueRule(
2219
self::getContainer()->getByType(Lexer::class),
2320
self::getContainer()->getByType(PhpDocParser::class),
24-
$this->checkAllInvalidPhpDocs,
21+
true,
2522
true,
2623
);
2724
}
2825

29-
public function dataRule(): iterable
26+
public function testRule(): void
3027
{
31-
$errors = [
28+
$this->analyse([__DIR__ . '/data/invalid-phpdoc.php'], [
3229
[
3330
'PHPDoc tag @param has invalid value (): Unexpected token "\n * ", expected type at offset 13 on line 2',
3431
6,
@@ -97,42 +94,25 @@ public function dataRule(): iterable
9794
'PHPDoc tag @var has invalid value ((Foo&): Unexpected token "*/", expected type at offset 15 on line 1',
9895
91,
9996
],
100-
];
101-
102-
yield [false, $errors];
103-
yield [true, array_merge($errors, [
10497
[
10598
'PHPDoc tag @var has invalid value ((Foo&): Unexpected token "*/", expected type at offset 15 on line 1',
10699
101,
107100
],
108-
])];
109-
}
110-
111-
/**
112-
* @dataProvider dataRule
113-
* @param list<array{0: string, 1: int, 2?: string}> $expectedErrors
114-
*/
115-
public function testRule(bool $checkAllInvalidPhpDocs, array $expectedErrors): void
116-
{
117-
$this->checkAllInvalidPhpDocs = $checkAllInvalidPhpDocs;
118-
$this->analyse([__DIR__ . '/data/invalid-phpdoc.php'], $expectedErrors);
101+
]);
119102
}
120103

121104
public function testBug4731(): void
122105
{
123-
$this->checkAllInvalidPhpDocs = true;
124106
$this->analyse([__DIR__ . '/data/bug-4731.php'], []);
125107
}
126108

127109
public function testBug4731WithoutFirstTag(): void
128110
{
129-
$this->checkAllInvalidPhpDocs = true;
130111
$this->analyse([__DIR__ . '/data/bug-4731-no-first-tag.php'], []);
131112
}
132113

133114
public function testInvalidTypeInTypeAlias(): void
134115
{
135-
$this->checkAllInvalidPhpDocs = true;
136116
$this->analyse([__DIR__ . '/data/invalid-type-type-alias.php'], [
137117
[
138118
'PHPDoc tag @phpstan-type InvalidFoo has invalid value: Unexpected token "{", expected TOKEN_PHPDOC_EOL at offset 65 on line 3',

tests/PHPStan/Rules/Properties/TypesAssignedToPropertiesRuleNoBleedingEdgeTest.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)