5
5
namespace Timeweb \Tests \PHPStan \Reflection ;
6
6
7
7
use PHPStan \Reflection \ParametersAcceptorSelector ;
8
- use PHPStan \Testing \TestCase ;
8
+ use PHPStan \Testing \PHPStanTestCase ;
9
9
use PHPStan \Type \VerbosityLevel ;
10
10
use Timeweb \PHPStan \Reflection \EnumMethodReflection ;
11
11
use Timeweb \PHPStan \Reflection \EnumMethodsClassReflectionExtension ;
14
14
/**
15
15
* @coversDefaultClass \Timeweb\PHPStan\Reflection\EnumMethodsClassReflectionExtension
16
16
*/
17
- class EnumMethodsClassReflectionExtensionTest extends TestCase
17
+ class EnumMethodsClassReflectionExtensionTest extends PHPStanTestCase
18
18
{
19
19
/**
20
- * @var \PHPStan\Broker\Broker
20
+ * @var \PHPStan\Reflection\ReflectionProvider
21
21
*/
22
- protected $ broker ;
22
+ protected $ reflectionProvider ;
23
23
24
24
/**
25
25
* @var EnumMethodsClassReflectionExtension
@@ -28,7 +28,7 @@ class EnumMethodsClassReflectionExtensionTest extends TestCase
28
28
29
29
public function setUp (): void
30
30
{
31
- $ this ->broker = $ this ->createBroker ();
31
+ $ this ->reflectionProvider = $ this ->createReflectionProvider ();
32
32
$ this ->reflectionExtension = new EnumMethodsClassReflectionExtension ();
33
33
}
34
34
@@ -38,7 +38,7 @@ public function setUp(): void
38
38
*/
39
39
public function testEnumMethodsCanBeFoundInEnumSubclasses (bool $ expected , string $ methodName ): void
40
40
{
41
- $ classReflection = $ this ->broker ->getClass (EnumFixture::class);
41
+ $ classReflection = $ this ->reflectionProvider ->getClass (EnumFixture::class);
42
42
$ hasMethod = $ this ->reflectionExtension ->hasMethod ($ classReflection , $ methodName );
43
43
44
44
$ this ->assertEquals ($ expected , $ hasMethod );
@@ -60,7 +60,7 @@ public function methodNameDataProvider(): array
60
60
*/
61
61
public function testEnumMethodsCannotBeFoundInNonEnumSubclasses (): void
62
62
{
63
- $ classReflection = $ this ->broker ->getClass (EnumFixture::class);
63
+ $ classReflection = $ this ->reflectionProvider ->getClass (EnumFixture::class);
64
64
$ hasMethod = $ this ->reflectionExtension ->hasMethod ($ classReflection , 'SOME_NAME ' );
65
65
66
66
$ this ->assertFalse ($ hasMethod );
@@ -72,7 +72,7 @@ public function testEnumMethodsCannotBeFoundInNonEnumSubclasses(): void
72
72
*/
73
73
public function testEnumMethodReflectionCanBeObtained (): void
74
74
{
75
- $ classReflection = $ this ->broker ->getClass (EnumFixture::class);
75
+ $ classReflection = $ this ->reflectionProvider ->getClass (EnumFixture::class);
76
76
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'SOME_NAME ' );
77
77
78
78
$ this ->assertInstanceOf (EnumMethodReflection::class, $ methodReflection );
@@ -91,7 +91,7 @@ public function testEnumMethodReflectionCanBeObtained(): void
91
91
*/
92
92
public function testEnumMethodProperties (string $ propertyName ): void
93
93
{
94
- $ classReflection = $ this ->broker ->getClass (EnumFixture::class);
94
+ $ classReflection = $ this ->reflectionProvider ->getClass (EnumFixture::class);
95
95
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , $ propertyName );
96
96
$ parametersAcceptor = ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ());
97
97
0 commit comments