File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ public function testSetReflector(): void {
3535 $ reflector = new \ReflectionClass (TestClassWithAttributes::class);
3636 $ attributes = get_attributes ($ reflector , ReflectorAwareTestAttribute::class);
3737 $ this ->assertSame ($ reflector , $ attributes [0 ]->reflector );
38+ }
3839
40+ public function testNotSetReflector (): void {
41+ $ reflector = new \ReflectionClass (TestClassWithAttributes::class);
3942 $ attributes = get_raw_attributes ($ reflector , ReflectorAwareTestAttribute::class);
4043 $ this ->assertNull ($ attributes [0 ]->reflector );
4144 }
@@ -46,7 +49,10 @@ public function testGetReflectorFromConstructor(): void {
4649 $ this ->assertSame ($ reflector , $ attribute ->reflectorIfSet );
4750 $ this ->assertSame ($ reflector , $ attribute ->reflector );
4851 $ this ->assertNull ($ attribute ->exception ?? NULL );
52+ }
4953
54+ public function testGetNoReflectorFromConstructor (): void {
55+ $ reflector = new \ReflectionClass (TestClassWithAttributes::class);
5056 [$ raw_attribute ] = get_raw_attributes ($ reflector , ReflectorAwareConstructorTestAttribute::class);
5157 $ this ->assertNull ($ raw_attribute ->reflectorIfSet );
5258 $ this ->assertNull ($ raw_attribute ->reflector ?? NULL );
You can’t perform that action at this time.
0 commit comments