Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed confusing test I changed earlier. Added a new test.

  • Loading branch information...
commit 73d0f2a16eb64c4e960a06523ba9d87ce4a0d1c3 1 parent e4b0756
@sam-at-github sam-at-github authored
Showing with 7 additions and 19 deletions.
  1. +7 −19 tests/TestCase/Routing/RouterTest.php
View
26 tests/TestCase/Routing/RouterTest.php
@@ -1846,37 +1846,25 @@ public function testPrefixOverride() {
}
/**
- * 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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.