|
|
@@ -1846,37 +1846,25 @@ class RouterTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Test that setting a prefix is just like setting any other default route parameter.
|
|
|
+ * Test that well known route parameters are passed through.
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function testPrefixJustADefault() {
|
|
|
+ public function testRouteParamDefaults() {
|
|
|
Configure::write('Routing.prefixes', array('admin'));
|
|
|
Router::reload();
|
|
|
+ Router::connect('/cache/*', array('prefix' => false, 'plugin' => true, 'controller' => 0, 'action' => 1));
|
|
|
|
|
|
- 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'));
|
|
|
+ $url = Router::url(array('controller' => 0, 'action' => 1, 'test'));
|
|
|
$expected = '/';
|
|
|
$this->assertEquals($expected, $url);
|
|
|
|
|
|
- $url = Router::url(array('prefix' => false, 'controller' => 'asset_compress', 'action' => 'get', 'test'));
|
|
|
+ $url = Router::url(array('prefix' => 1, 'controller' => 0, 'action' => 1, 'test'));
|
|
|
$expected = '/';
|
|
|
$this->assertEquals($expected, $url);
|
|
|
|
|
|
- $url = Router::url(array('prefix' => false, 'anything' => false, 'controller' => 'asset_compress', 'action' => 'get', 'test'));
|
|
|
- $expected = '/cache_css/test';
|
|
|
+ $url = Router::url(array('prefix' => 0, 'plugin' => 1, 'controller' => 0, 'action' => 1, 'test'));
|
|
|
+ $expected = '/cache/test';
|
|
|
$this->assertEquals($expected, $url);
|
|
|
}
|
|
|
|