Skip to content

Commit 306e7a8

Browse files
authored
Add test failing on array types on PHP 8+ (#191)
1 parent 520bb1d commit 306e7a8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/InjectorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
class InjectorTest extends TestCase
99
{
10+
public function testArrayTypehintDoesNotEvaluatesAsClass()
11+
{
12+
$injector = new Injector;
13+
$injector->defineParam('parameter', []);
14+
$injector->execute('Auryn\Test\hasArrayDependency');
15+
}
16+
1017
public function testMakeInstanceInjectsSimpleConcreteDependency()
1118
{
1219
$injector = new Injector;

test/fixtures.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ public function __invoke()
426426
}
427427
}
428428

429+
function hasArrayDependency(array $parameter)
430+
{
431+
return 42;
432+
}
433+
429434
function testExecuteFunction()
430435
{
431436
return 42;

0 commit comments

Comments
 (0)