From c373d5b6568ac93ab1d7496d2254b1b6bd8e44d5 Mon Sep 17 00:00:00 2001 From: Eric Clemmons Date: Wed, 1 Feb 2012 20:53:43 -0800 Subject: [PATCH] Added RouteCollectionTest#testAddCollectionOverridesDefaultsAndRequirements --- .../Tests/Component/Routing/RouteCollectionTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php b/tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php index a5081dfbae..644f095b40 100644 --- a/tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php +++ b/tests/Symfony/Tests/Component/Routing/RouteCollectionTest.php @@ -141,6 +141,19 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase $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();