Skip to content

Commit

Permalink
[BUGFIX] DI fails with CompilerDefinition; solves zendframework#5738
Browse files Browse the repository at this point in the history
…- Test
  • Loading branch information
Michael Schiller committed Jan 22, 2014
1 parent 19e0768 commit ba051e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ZendTest/Di/Definition/CompilerDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,16 @@ public function testExcludeAwareMethodsWithoutParameters()
$this->assertTrue($definition->hasMethod('ZendTest\Di\TestAsset\AwareClasses\B', 'setSomething'));
$this->assertFalse($definition->hasMethod('ZendTest\Di\TestAsset\AwareClasses\B', 'getSomething'));
}

public function testHasMethodParameters()
{
$definition = new CompilerDefinition();
$definition->addDirectory(__DIR__ . '/../TestAsset/ConstructorInjection');
$definition->addDirectory(__DIR__ . '/../TestAsset/SetterInjection');
$definition->addDirectory(__DIR__ . '/../TestAsset/CompilerClasses');
$definition->compile();
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\ConstructorInjection\B', '__construct'));
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\SetterInjection\B', 'setA'));
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\CompilerClasses\D', 'setB'));
}
}

0 comments on commit ba051e5

Please sign in to comment.