public function RouteCollectionTest::testAddPrefixOverridesDefaultsAndRequirements in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/RouteCollectionTest.php \Symfony\Component\Routing\Tests\RouteCollectionTest::testAddPrefixOverridesDefaultsAndRequirements()
File
- vendor/
symfony/ routing/ Tests/ RouteCollectionTest.php, line 164
Class
Namespace
Symfony\Component\Routing\TestsCode
public function testAddPrefixOverridesDefaultsAndRequirements() {
$collection = new RouteCollection();
$collection
->add('foo', $foo = new Route('/foo.{_format}'));
$collection
->add('bar', $bar = new Route('/bar.{_format}', array(), array(
'_format' => 'json',
)));
$collection
->addPrefix('/admin', array(), array(
'_format' => 'html',
));
$this
->assertEquals('html', $collection
->get('foo')
->getRequirement('_format'), '->addPrefix() overrides existing requirements');
$this
->assertEquals('html', $collection
->get('bar')
->getRequirement('_format'), '->addPrefix() overrides existing requirements');
}