File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,18 @@ public function testFromClassWithUnionSelfDependency(): void
6969 {
7070 $ definition = DefinitionExtractor::fromClassName (UnionSelfDependency::class)['a ' ];
7171
72- $ actualType = implode ('| ' , $ definition
73- ->getReflection ()
74- ->getType ()
75- ->getTypes ());
72+ $ actualType = implode (
73+ '| ' ,
74+ $ definition ->getReflection ()->getType ()->getTypes (),
75+ );
76+
77+ $ self = PHP_VERSION_ID < 80500 ? 'self ' : UnionSelfDependency::class;
78+
7679 $ this ->assertInstanceOf (ParameterDefinition::class, $ definition );
77- $ this ->assertSame ('self| ' . ColorInterface::class, $ actualType );
80+ $ this ->assertSame (
81+ $ self . '| ' . ColorInterface::class,
82+ $ actualType ,
83+ );
7884 }
7985
8086 public function testResolveCarConstructor (): void
@@ -153,16 +159,12 @@ public function testFromNotInstantiableClass(): void
153159
154160 public function testFromClassWithSelfDependency (): void
155161 {
156- /** @var ParameterDefinition $definition */
157162 $ definition = DefinitionExtractor::fromClassName (SelfDependency::class)['a ' ];
158163
159164 $ this ->assertInstanceOf (ParameterDefinition::class, $ definition );
160165 $ this ->assertSame (
161- 'self ' ,
162- $ definition
163- ->getReflection ()
164- ->getType ()
165- ->getName (),
166+ PHP_VERSION_ID > 80500 ? 'self ' : SelfDependency::class,
167+ $ definition ->getReflection ()->getType ()->getName (),
166168 );
167169 }
168170
You can’t perform that action at this time.
0 commit comments