public function XmlFileLoaderTest::testLoadWithImport

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php, line 54

Class

XmlFileLoaderTest

Namespace

Symfony\Component\Routing\Tests\Loader

Code

public function testLoadWithImport() {
  $loader = new XmlFileLoader(new FileLocator(array(
    __DIR__ . '/../Fixtures',
  )));
  $routeCollection = $loader
    ->load('validresource.xml');
  $routes = $routeCollection
    ->all();
  $this
    ->assertEquals(1, count($routes), 'One route is loaded');
  $this
    ->assertContainsOnly('Symfony\\Component\\Routing\\Route', $routes);
  $this
    ->assertEquals('foo', $routes['blog_show']
    ->getDefault('foo'));
  $this
    ->assertEquals('\\d+', $routes['blog_show']
    ->getRequirement('foo'));
  $this
    ->assertEquals('bar', $routes['blog_show']
    ->getOption('foo'));
}