forked from phpstan/phpstan-phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssertSameBooleanExpectedRuleTest.php
More file actions
60 lines (52 loc) · 1.27 KB
/
AssertSameBooleanExpectedRuleTest.php
File metadata and controls
60 lines (52 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php declare(strict_types = 1);
namespace PHPStan\Rules\PHPUnit;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<AssertSameBooleanExpectedRule>
*/
class AssertSameBooleanExpectedRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new AssertSameBooleanExpectedRule();
}
public function testRule(): void
{
$this->analyse([__DIR__ . '/data/assert-same-boolean-expected.php'], [
[
'You should use assertTrue() instead of assertSame() when expecting "true"',
10,
],
[
'You should use assertFalse() instead of assertSame() when expecting "false"',
11,
],
[
'You should use assertTrue() instead of assertSame() when expecting "true"',
26,
],
[
'You should use assertTrue() instead of assertSame() when expecting "true"',
74,
],
[
'You should use assertFalse() instead of assertSame() when expecting "false"',
75,
],
]);
}
public function testFix(): void
{
$this->fix(__DIR__ . '/data/assert-same-boolean-expected-fixable.php', __DIR__ . '/data/assert-same-boolean-expected-fixable.php.fixed');
}
/**
* @return string[]
*/
public static function getAdditionalConfigFiles(): array
{
return [
__DIR__ . '/../../../extension.neon',
];
}
}