public function RouteCollectionTest::testResource

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php, line 187

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testResource() {
  if (!class_exists('Symfony\\Component\\Config\\Resource\\FileResource')) {
    $this
      ->markTestSkipped('The "Config" component is not available');
  }
  $collection = new RouteCollection();
  $collection
    ->addResource($foo = new FileResource(__DIR__ . '/Fixtures/foo.xml'));
  $this
    ->assertEquals(array(
    $foo,
  ), $collection
    ->getResources(), '->addResources() adds a resource');
}