-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathOverrideDeprecatedMethodRuleTest.php
44 lines (38 loc) · 1.17 KB
/
OverrideDeprecatedMethodRuleTest.php
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
<?php declare(strict_types = 1);
namespace PHPStan\Rules\Deprecations;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<OverrideDeprecatedMethodRule>
*/
class OverrideDeprecatedMethodRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new OverrideDeprecatedMethodRule(new DeprecatedScopeHelper([new DefaultDeprecatedScopeResolver()]));
}
public function testDeprecatedMethodOverride(): void
{
$this->analyse(
[__DIR__ . '/data/override-deprecated-method.php'],
[
[
'Class OverrideDeprecatedMethod\Child overrides deprecated method deprecatedMethod of class OverrideDeprecatedMethod\Ancestor.',
49,
],
[
'Class OverrideDeprecatedMethod\Child overrides deprecated method deprecatedInInterface of interface OverrideDeprecatedMethod\Deprecated.',
61,
],
[
'Class OverrideDeprecatedMethod\Child overrides deprecated method deprecatedInTrait of class OverrideDeprecatedMethod\Ancestor.',
64,
],
[
'Class OverrideDeprecatedMethod\GrandChild overrides deprecated method deprecatedInChild of class OverrideDeprecatedMethod\Child.',
73,
],
]
);
}
}