Skip to content

Commit

Permalink
Add test for #4309
Browse files Browse the repository at this point in the history
The Router internals don't handle // which is good.
  • Loading branch information
markstory committed Aug 24, 2014
1 parent cd7438d commit f0f1531
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/Cake/Test/Case/Routing/RouterTest.php
Expand Up @@ -996,6 +996,23 @@ public function testCanLeavePlugin() {
$this->assertEquals('/admin/other/posts/index', $result);
}

/**
* Test that URL's fail to parse when they are prefixed with //
*
* @return void
*/
public function testUrlParseFailureDoubleSlash() {
Router::connect('/posts', array('controller' => 'posts', 'action' => 'index'));
$result = Router::parse('/posts');
$this->assertEquals(
array('pass' => array(), 'named' => array(), 'plugin' => null, 'controller' => 'posts', 'action' => 'index'),
$result
);

$result = Router::parse('//posts');
$this->assertEquals(array(), $result);
}

/**
* testUrlParsing method
*
Expand Down

0 comments on commit f0f1531

Please sign in to comment.