Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added RouteCollectionTest#testAddCollectionOverridesDefaultsAndRequir…
…ements
  • Loading branch information
ericclemmons committed Feb 2, 2012
1 parent b91240b commit c373d5b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php
Expand Up @@ -141,6 +141,19 @@ public function testAddPrefixOverridesDefaultsAndRequirements()
$this->assertEquals('https', $collection->get('bar')->getRequirement('_scheme'), '->addPrefix() overrides existing requirements');
}

public function testAddCollectionOverridesDefaultsAndRequirements()
{
$imported = new RouteCollection();
$imported->add('foo', $foo = new Route('/foo'));
$imported->add('bar', $bar = new Route('/bar', array(), array('_scheme' => 'http')));

$collection = new RouteCollection();
$collection->addCollection($imported, null, array(), array('_scheme' => 'https'));

$this->assertEquals('https', $collection->get('foo')->getRequirement('_scheme'), '->addCollection() overrides existing requirements');
$this->assertEquals('https', $collection->get('bar')->getRequirement('_scheme'), '->addCollection() overrides existing requirements');
}

public function testResource()
{
$collection = new RouteCollection();
Expand Down

0 comments on commit c373d5b

Please sign in to comment.