From a7b1e34c1b18abd07daaa4d793aef200daffb24c Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 12 Feb 2014 02:25:00 +1100 Subject: [PATCH] Updated test. Setting a prefix route param default is now just like setting any other route param default. --- tests/TestCase/Routing/RouterTest.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/TestCase/Routing/RouterTest.php b/tests/TestCase/Routing/RouterTest.php index baba90d0066..d5a1677f28b 100644 --- a/tests/TestCase/Routing/RouterTest.php +++ b/tests/TestCase/Routing/RouterTest.php @@ -1846,21 +1846,36 @@ public function testPrefixOverride() { } /** - * Test that setting a prefix to false is ignored, as its generally user error. + * Test that setting a prefix to is just like setting any other default route parameter. * * @return void */ - public function testPrefixFalseIgnored() { + public function testPrefixJustADefault() { Configure::write('Routing.prefixes', array('admin')); Router::reload(); Router::connect('/cache_css/*', array('prefix' => false, 'controller' => 'asset_compress', 'action' => 'get')); $url = Router::url(array('controller' => 'asset_compress', 'action' => 'get', 'test')); + $expected = '/'; + $this->assertEquals($expected, $url); + + $url = Router::url(array('prefix' => false, 'controller' => 'asset_compress', 'action' => 'get', 'test')); $expected = '/cache_css/test'; $this->assertEquals($expected, $url); + Router::reload(); + Router::connect('/cache_css/*', array('prefix' => false, 'anything' => false, 'controller' => 'asset_compress', 'action' => 'get')); + + $url = Router::url(array('controller' => 'asset_compress', 'action' => 'get', 'test')); + $expected = '/'; + $this->assertEquals($expected, $url); + $url = Router::url(array('prefix' => false, 'controller' => 'asset_compress', 'action' => 'get', 'test')); + $expected = '/'; + $this->assertEquals($expected, $url); + + $url = Router::url(array('prefix' => false, 'anything' => false, 'controller' => 'asset_compress', 'action' => 'get', 'test')); $expected = '/cache_css/test'; $this->assertEquals($expected, $url); }