forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConflictingTraitMethodsRuleTest.php
More file actions
49 lines (42 loc) · 1.48 KB
/
ConflictingTraitMethodsRuleTest.php
File metadata and controls
49 lines (42 loc) · 1.48 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
<?php declare(strict_types = 1);
namespace PHPStan\Rules\Classes;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<ConflictingTraitMethodsRule>
*/
class ConflictingTraitMethodsRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new ConflictingTraitMethodsRule(
self::getContainer()->getByType(ReflectionProvider::class),
);
}
public function testBug14332(): void
{
$this->analyse([__DIR__ . '/data/bug-14332.php'], [
[
'Trait method Bug14332\MyTrait2::doSomething() has not been applied as Bug14332\FooWithMultipleConflictingTraits::doSomething(), because of collision with Bug14332\MyTrait1::doSomething().',
20,
],
[
'Trait method Bug14332\MyTrait4::doSomething() has not been applied as Bug14332\FooWithMultipleConflicts::doSomething(), because of collision with Bug14332\MyTrait1::doSomething().',
75,
],
[
'Trait method Bug14332\MyTrait5::anotherMethod() has not been applied as Bug14332\FooWithMultipleConflicts::anotherMethod(), because of collision with Bug14332\MyTrait4::anotherMethod().',
75,
],
[
'Trait method Bug14332\MyTrait5::anotherMethod() has not been applied as Bug14332\FooWithPartialResolution::anotherMethod(), because of collision with Bug14332\MyTrait4::anotherMethod().',
81,
],
]);
}
public function testBug14332Abstract(): void
{
$this->analyse([__DIR__ . '/data/bug-14332-abstract.php'], []);
}
}