Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
[BUGFIX] DI fails with CompilerDefinition; solves zendframework/zendf…
Browse files Browse the repository at this point in the history
…ramework#5738 - Test - assertions on false added
  • Loading branch information
Michael Schiller committed Feb 28, 2014
1 parent 2d62d4b commit a53cf81
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Definition/CompilerDefinitionTest.php
Expand Up @@ -139,8 +139,18 @@ public function testHasMethodParameters()
$definition->addDirectory(__DIR__ . '/../TestAsset/SetterInjection');
$definition->addDirectory(__DIR__ . '/../TestAsset/CompilerClasses');
$definition->compile();

// constructor injection
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\ConstructorInjection\B', '__construct'));
// setter injection
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\SetterInjection\B', 'setA'));
// setter injection with method from derived class
$this->assertTrue($definition->hasMethodParameters('ZendTest\Di\TestAsset\CompilerClasses\D', 'setB'));
// class does not exist
$this->assertFalse($definition->hasMethodParameters('ZendTest\Di\TestAsset\ConstructorInjection\BB', '__construct'));
// method not existing
$this->assertFalse($definition->hasMethodParameters('ZendTest\Di\TestAsset\SetterInjection\B', 'setB'));
// method exists but has no parameters
$this->assertFalse($definition->hasMethodParameters('ZendTest\Di\TestAsset\SetterInjection\StaticSetter', 'setFoo'));
}
}

0 comments on commit a53cf81

Please sign in to comment.