Skip to content

Commit

Permalink
Add test failing on array types on PHP 8+ (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvax authored Mar 4, 2021
1 parent 520bb1d commit 306e7a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/InjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

class InjectorTest extends TestCase
{
public function testArrayTypehintDoesNotEvaluatesAsClass()
{
$injector = new Injector;
$injector->defineParam('parameter', []);
$injector->execute('Auryn\Test\hasArrayDependency');
}

public function testMakeInstanceInjectsSimpleConcreteDependency()
{
$injector = new Injector;
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ public function __invoke()
}
}

function hasArrayDependency(array $parameter)
{
return 42;
}

function testExecuteFunction()
{
return 42;
Expand Down

0 comments on commit 306e7a8

Please sign in to comment.