public setMatcherBuilder ( eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface $matcherBuilder ) | ||
$matcherBuilder | eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface |
public function setMatcherBuilder(MatcherBuilderInterface $matcherBuilder)
{
$this->matcherBuilder = $matcherBuilder;
foreach ($this->config as $i => $rule) {
foreach ($rule['matchers'] as $matcherClass => $matchingConfig) {
$this->matchersMap[$i][$matcherClass] = $matcherBuilder->buildMatcher($matcherClass, $matchingConfig, $this->request);
}
}
}
/** * @depends testConstruct */ public function testSetMatcherBuilder(Compound $compoundMatcher) { $this->matcherBuilder->expects($this->any())->method('buildMatcher')->will($this->returnValue($this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher'))); $compoundMatcher->setRequest($this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\Routing\\SimplifiedRequest')); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $matchers = $compoundMatcher->getSubMatchers(); $this->assertInternalType('array', $matchers); foreach ($matchers as $matcher) { $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher', $matcher); } }