/** * Load routes collection from XML fixture routes under Tests\Fixtures directory. * * @param string $fixtureName name of the class fixture */ protected function loadFromXmlCollectionFixture($fixtureName) { $collectionLoader = new RestXmlCollectionLoader(new FileLocator(array(__DIR__ . '/../../Fixtures/Routes')), new RestRouteProcessor()); $controllerLoader = $this->getControllerLoader(); $resolver = new LoaderResolver(array($collectionLoader, $controllerLoader)); return $collectionLoader->load($fixtureName, 'rest'); }
/** * Load routes collection from XML fixture routes under Tests\Fixtures directory. * * @param string $fixtureName name of the class fixture * @param bool $includeFormat whether or not the requested view format must be included in the route path * @param string[] $formats supported view formats * @param string $defaultFormat default view format * * @return RouteCollection */ protected function loadFromXmlCollectionFixture($fixtureName, $includeFormat = true, array $formats = array('json' => false, 'xml' => false, 'html' => true), $defaultFormat = null) { $collectionLoader = new RestXmlCollectionLoader(new FileLocator(array(__DIR__ . '/../../Fixtures/Routes')), new RestRouteProcessor(), $includeFormat, $formats, $defaultFormat); $controllerLoader = $this->getControllerLoader(); new LoaderResolver(array($collectionLoader, $controllerLoader)); return $collectionLoader->load($fixtureName, 'rest'); }