本文整理汇总了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());
}