13
13
class EnumMethodReflectionTest extends PHPStanTestCase
14
14
{
15
15
/**
16
- * @var \PHPStan\Broker\Broker
16
+ * @var \PHPStan\Reflection\ReflectionProvider
17
17
*/
18
- protected $ broker ;
18
+ protected $ reflectionProvider ;
19
19
20
20
/**
21
21
* @var EnumMethodsClassReflectionExtension
@@ -24,61 +24,61 @@ class EnumMethodReflectionTest extends PHPStanTestCase
24
24
25
25
public function setUp (): void
26
26
{
27
- $ this ->broker = $ this ->createBroker ();
27
+ $ this ->reflectionProvider = $ this ->createReflectionProvider ();
28
28
$ this ->reflectionExtension = new EnumMethodsClassReflectionExtension ();
29
29
}
30
30
31
31
public function testGetName (): void
32
32
{
33
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
33
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
34
34
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
35
35
36
36
$ this ->assertSame ('STR ' , $ methodReflection ->getName ());
37
37
}
38
38
39
39
public function testGetDeclaringClass (): void
40
40
{
41
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
41
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
42
42
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
43
43
44
44
$ this ->assertSame ($ classReflection , $ methodReflection ->getDeclaringClass ());
45
45
}
46
46
47
47
public function testShouldBeStatic (): void
48
48
{
49
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
49
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
50
50
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
51
51
52
52
$ this ->assertTrue ($ methodReflection ->isStatic ());
53
53
}
54
54
55
55
public function testShouldNotBePrivate (): void
56
56
{
57
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
57
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
58
58
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
59
59
60
60
$ this ->assertFalse ($ methodReflection ->isPrivate ());
61
61
}
62
62
63
63
public function testShouldBePublic (): void
64
64
{
65
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
65
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
66
66
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
67
67
68
68
$ this ->assertTrue ($ methodReflection ->isPublic ());
69
69
}
70
70
71
71
public function testGetPrototype (): void
72
72
{
73
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
73
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
74
74
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
75
75
76
76
$ this ->assertSame ($ methodReflection , $ methodReflection ->getPrototype ());
77
77
}
78
78
79
79
public function testGetVariants (): void
80
80
{
81
- $ classReflection = $ this ->broker ->getClass (VisibilityEnum::class);
81
+ $ classReflection = $ this ->reflectionProvider ->getClass (VisibilityEnum::class);
82
82
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
83
83
$ parametersAcceptor = ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ());
84
84
@@ -87,7 +87,7 @@ public function testGetVariants(): void
87
87
88
88
public function testGetDocComment (): void
89
89
{
90
- $ classReflection = $ this ->broker ->getClass (DocCommentEnum::class);
90
+ $ classReflection = $ this ->reflectionProvider ->getClass (DocCommentEnum::class);
91
91
$ docMethodRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'WITH_DOC_BLOCK ' );
92
92
$ noDocMethodRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'WITHOUT_DOC_BLOCK ' );
93
93
@@ -103,7 +103,7 @@ public function testGetDocComment(): void
103
103
104
104
public function testIsDeprecated (): void
105
105
{
106
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
106
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
107
107
$ deprecatedRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'DEPRECATED ' );
108
108
$ notDeprecatedRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'NOT_DEPRECATED ' );
109
109
@@ -113,7 +113,7 @@ public function testIsDeprecated(): void
113
113
114
114
public function testGetDeprecatedDescription (): void
115
115
{
116
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
116
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
117
117
$ deprecatedRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'DEPRECATED ' );
118
118
$ notDeprecatedRefl = $ this ->reflectionExtension ->getMethod ($ classReflection , 'NOT_DEPRECATED ' );
119
119
@@ -123,31 +123,31 @@ public function testGetDeprecatedDescription(): void
123
123
124
124
public function testIsFinal (): void
125
125
{
126
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
126
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
127
127
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
128
128
129
129
$ this ->assertTrue ($ methodReflection ->isFinal ()->no ());
130
130
}
131
131
132
132
public function testIsInternal (): void
133
133
{
134
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
134
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
135
135
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
136
136
137
137
$ this ->assertTrue ($ methodReflection ->isInternal ()->no ());
138
138
}
139
139
140
140
public function testGetThrowType (): void
141
141
{
142
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
142
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
143
143
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
144
144
145
145
$ this ->assertNull ($ methodReflection ->getThrowType ());
146
146
}
147
147
148
148
public function testHasSideEffects (): void
149
149
{
150
- $ classReflection = $ this ->broker ->getClass (DeprecatedEnum::class);
150
+ $ classReflection = $ this ->reflectionProvider ->getClass (DeprecatedEnum::class);
151
151
$ methodReflection = $ this ->reflectionExtension ->getMethod ($ classReflection , 'STR ' );
152
152
153
153
$ this ->assertTrue ($ methodReflection ->hasSideEffects ()->no ());
0 commit comments