3
3
namespace PHPStan \Reflection \Doctrine ;
4
4
5
5
use Doctrine \Common \Collections \Collection ;
6
- use PHPStan \Broker \ Broker ;
6
+ use PHPStan \Reflection \ ReflectionProvider ;
7
7
use PHPStan \Testing \PHPStanTestCase ;
8
8
9
9
final class DoctrineSelectableClassReflectionExtensionTest extends PHPStanTestCase
10
10
{
11
11
12
- /** @var Broker */
13
- private $ broker ;
12
+ /** @var ReflectionProvider */
13
+ private $ reflectionProvider ;
14
14
15
15
/** @var DoctrineSelectableClassReflectionExtension */
16
16
private $ extension ;
17
17
18
18
protected function setUp (): void
19
19
{
20
- $ this ->broker = $ this ->createBroker ();
21
-
22
- $ this ->extension = new DoctrineSelectableClassReflectionExtension ();
23
- $ this ->extension ->setBroker ($ this ->broker );
20
+ $ this ->reflectionProvider = $ this ->createReflectionProvider ();
21
+ $ this ->extension = new DoctrineSelectableClassReflectionExtension ($ this ->reflectionProvider );
24
22
}
25
23
26
24
/**
@@ -39,13 +37,13 @@ public function dataHasMethod(): array
39
37
*/
40
38
public function testHasMethod (string $ className , string $ method , bool $ expectedResult ): void
41
39
{
42
- $ classReflection = $ this ->broker ->getClass ($ className );
40
+ $ classReflection = $ this ->reflectionProvider ->getClass ($ className );
43
41
self ::assertSame ($ expectedResult , $ this ->extension ->hasMethod ($ classReflection , $ method ));
44
42
}
45
43
46
44
public function testGetMethod (): void
47
45
{
48
- $ classReflection = $ this ->broker ->getClass (Collection::class);
46
+ $ classReflection = $ this ->reflectionProvider ->getClass (Collection::class);
49
47
$ methodReflection = $ this ->extension ->getMethod ($ classReflection , 'matching ' );
50
48
self ::assertSame ('matching ' , $ methodReflection ->getName ());
51
49
}
0 commit comments