本文整理匯總了PHP中Symfony\Component\Config\Loader\LoaderInterface::reveal方法的典型用法代碼示例。如果您正苦於以下問題:PHP LoaderInterface::reveal方法的具體用法?PHP LoaderInterface::reveal怎麽用?PHP LoaderInterface::reveal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Config\Loader\LoaderInterface
的用法示例。
在下文中一共展示了LoaderInterface::reveal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testLoad
public function testLoad()
{
$importedRouteCollection = new RouteCollection();
$importedRouteCollection->add('route1', new Route('/example/route1'));
$importedRouteCollection->add('route2', new Route('/route2'));
$portal1 = new Portal();
$portal1->setKey('sulu_lo');
$portal2 = new Portal();
$portal2->setKey('sulu_com');
$portalInformations = [new PortalInformation(null, null, $portal1, null, 'sulu.io/de'), new PortalInformation(null, null, $portal2, null, 'sulu.com')];
$this->loaderResolver->resolve(Argument::any(), Argument::any())->willReturn($this->loader->reveal());
$this->loader->load(Argument::any(), Argument::any())->willReturn($importedRouteCollection);
$this->webspaceManager->getPortalInformations(Argument::any())->willReturn($portalInformations);
$routeCollection = $this->portalLoader->load('', 'portal');
$this->assertCount(4, $routeCollection);
$routes = $routeCollection->getIterator();
$this->assertArrayHasKey('sulu.io/de.route1', $routes);
$this->assertArrayHasKey('sulu.io/de.route2', $routes);
$this->assertArrayHasKey('sulu.com.route1', $routes);
$this->assertArrayHasKey('sulu.com.route2', $routes);
$this->assertEquals('/de/example/route1', $routeCollection->get('sulu.io/de.route1')->getPath());
$this->assertEquals('/de/route2', $routeCollection->get('sulu.io/de.route2')->getPath());
$this->assertEquals('/example/route1', $routeCollection->get('sulu.com.route1')->getPath());
$this->assertEquals('/route2', $routeCollection->get('sulu.com.route2')->getPath());
}