You are here

public function RouteCollectionTest::testResource in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/RouteCollectionTest.php \Symfony\Component\Routing\Tests\RouteCollectionTest::testResource()

File

vendor/symfony/routing/Tests/RouteCollectionTest.php, line 175

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testResource() {
  $collection = new RouteCollection();
  $collection
    ->addResource($foo = new FileResource(__DIR__ . '/Fixtures/foo.xml'));
  $collection
    ->addResource($bar = new FileResource(__DIR__ . '/Fixtures/bar.xml'));
  $collection
    ->addResource(new FileResource(__DIR__ . '/Fixtures/foo.xml'));
  $this
    ->assertEquals(array(
    $foo,
    $bar,
  ), $collection
    ->getResources(), '->addResource() adds a resource and getResources() only returns unique ones by comparing the string representation');
}