22
33namespace PHPStan \Reflection \Dibi ;
44
5- use PHPStan \Reflection \ClassReflection ;
6-
7- class DibiFluentClassReflectionExtensionTest extends \PHPUnit \Framework \TestCase
5+ class DibiFluentClassReflectionExtensionTest extends \PHPStan \Testing \TestCase
86{
97
8+ /** @var \PHPStan\Broker\Broker */
9+ private $ broker ;
10+
1011 /** @var \PHPStan\Reflection\Dibi\DibiFluentClassReflectionExtension */
1112 private $ extension ;
1213
1314 protected function setUp ()
1415 {
16+ $ this ->broker = $ this ->createBroker ();
1517 $ this ->extension = new DibiFluentClassReflectionExtension ();
1618 }
1719
@@ -36,15 +38,13 @@ public function dataHasMethod(): array
3638 */
3739 public function testHasMethod (string $ className , bool $ result )
3840 {
39- $ classReflection = $ this ->createMock (ClassReflection::class);
40- $ classReflection ->method ('getName ' )->will ($ this ->returnValue ($ className ));
41+ $ classReflection = $ this ->broker ->getClass ($ className );
4142 $ this ->assertSame ($ result , $ this ->extension ->hasMethod ($ classReflection , 'select ' ));
4243 }
4344
4445 public function testGetMethod ()
4546 {
46- $ classReflection = $ this ->createMock (ClassReflection::class);
47- $ classReflection ->method ('getName ' )->will ($ this ->returnValue (\Dibi \Fluent::class));
47+ $ classReflection = $ this ->broker ->getClass (\Dibi \Fluent::class);
4848 $ methodReflection = $ this ->extension ->getMethod ($ classReflection , 'select ' );
4949 $ this ->assertSame ('select ' , $ methodReflection ->getName ());
5050 $ this ->assertSame ($ classReflection , $ methodReflection ->getDeclaringClass ());
0 commit comments