33namespace PHPStan \Reflection \Doctrine ;
44
55use Doctrine \Common \Collections \Collection ;
6- use PHPStan \Broker \ Broker ;
6+ use PHPStan \Reflection \ ReflectionProvider ;
77use PHPStan \Testing \PHPStanTestCase ;
88
99final class DoctrineSelectableClassReflectionExtensionTest extends PHPStanTestCase
1010{
1111
12- /** @var Broker */
13- private $ broker ;
12+ /** @var ReflectionProvider */
13+ private $ reflectionProvider ;
1414
1515 /** @var DoctrineSelectableClassReflectionExtension */
1616 private $ extension ;
1717
1818 protected function setUp (): void
1919 {
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 );
2422 }
2523
2624 /**
@@ -39,13 +37,13 @@ public function dataHasMethod(): array
3937 */
4038 public function testHasMethod (string $ className , string $ method , bool $ expectedResult ): void
4139 {
42- $ classReflection = $ this ->broker ->getClass ($ className );
40+ $ classReflection = $ this ->reflectionProvider ->getClass ($ className );
4341 self ::assertSame ($ expectedResult , $ this ->extension ->hasMethod ($ classReflection , $ method ));
4442 }
4543
4644 public function testGetMethod (): void
4745 {
48- $ classReflection = $ this ->broker ->getClass (Collection::class);
46+ $ classReflection = $ this ->reflectionProvider ->getClass (Collection::class);
4947 $ methodReflection = $ this ->extension ->getMethod ($ classReflection , 'matching ' );
5048 self ::assertSame ('matching ' , $ methodReflection ->getName ());
5149 }
0 commit comments