File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ public function testAutowireWithInvalidInternalClass(): void
296296 $ this ->assertInstanceOf (Exception::class, $ container ->get (Exception::class));
297297 } else {
298298 // PHP 7.x
299+ // Cannot determine default value for internal functions
299300 $ this ->expectException (InvalidDefinitionException::class);
300301 $ container ->get (Exception::class);
301302 }
@@ -308,11 +309,18 @@ public function testAutowireWithInvalidInternalClass(): void
308309 */
309310 public function testAutowireWithInvalidInternalInterface (): void
310311 {
311- $ this ->expectException (InvalidDefinitionException::class);
312-
313312 $ container = new Container ();
314313 $ container ->addResolver (new ConstructorResolver ($ container ));
315- $ container ->get (NotFoundException::class);
314+
315+ if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
316+ // PHP 8+
317+ $ this ->assertInstanceOf (NotFoundException::class, $ container ->get (NotFoundException::class));
318+ } else {
319+ // PHP 7.x
320+ // Cannot determine default value for internal functions
321+ $ this ->expectException (InvalidDefinitionException::class);
322+ $ container ->get (NotFoundException::class);
323+ }
316324 }
317325
318326 /**
You can’t perform that action at this time.
0 commit comments