eZ\Bundle\EzPublishCoreBundle\Tests\Matcher\BlockMatcherFactoryTest::testSetSiteAccess PHP Метод

testSetSiteAccess() публичный Метод

public testSetSiteAccess ( )
    public function testSetSiteAccess()
    {
        $matcherServiceIdentifier = 'my.matcher.service';
        $resolverMock = $this->getMock('eZ\\Publish\\Core\\MVC\\ConfigResolverInterface');
        $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
        $siteAccessName = 'siteaccess_name';
        $updatedMatchConfig = array('full' => array('matchRule2' => array('template' => 'my_other_template.html.twig', 'match' => array('foo' => array('bar')))));
        $resolverMock->expects($this->atLeastOnce())->method('getParameter')->will($this->returnValueMap(array(array('block_view', null, null, array('full' => array('matchRule' => array('template' => 'my_template.html.twig', 'match' => array($matcherServiceIdentifier => 'someValue'))))), array('block_view', 'ezsettings', $siteAccessName, $updatedMatchConfig))));
        $matcherFactory = new BlockMatcherFactory($resolverMock, $this->getMock('eZ\\Publish\\API\\Repository\\Repository'));
        $matcherFactory->setContainer($container);
        $matcherFactory->setSiteAccess(new SiteAccess($siteAccessName));
        $refObj = new \ReflectionObject($matcherFactory);
        $refProp = $refObj->getProperty('matchConfig');
        $refProp->setAccessible(true);
        $this->assertSame($updatedMatchConfig, $refProp->getValue($matcherFactory));
    }