File tree 2 files changed +10
-1
lines changed
tests/tests/StaticAnalysis/Value
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,11 @@ public function endLine(): int
135
135
return $ this ->endLine ;
136
136
}
137
137
138
+ public function hasParent (): bool
139
+ {
140
+ return $ this ->parentClass !== null ;
141
+ }
142
+
138
143
/**
139
144
* @return ?non-empty-string
140
145
*/
Original file line number Diff line number Diff line change @@ -51,11 +51,15 @@ public function testMayHaveParentClass(): void
51
51
{
52
52
$ parentClass = 'example\ParentClass ' ;
53
53
54
- $ this ->assertSame ($ parentClass , $ this ->class (parentClass: $ parentClass )->parentClass ());
54
+ $ class = $ this ->class (parentClass: $ parentClass );
55
+
56
+ $ this ->assertTrue ($ class ->hasParent ());
57
+ $ this ->assertSame ($ parentClass , $ class ->parentClass ());
55
58
}
56
59
57
60
public function testMayNotHaveParentClass (): void
58
61
{
62
+ $ this ->assertFalse ($ this ->class ()->hasParent ());
59
63
$ this ->assertNull ($ this ->class ()->parentClass ());
60
64
}
61
65
You can’t perform that action at this time.
0 commit comments