Skip to content
Permalink
Browse files

Add test for #4309

The Router internals don't handle // which is good.
  • Loading branch information...
markstory committed Aug 24, 2014
1 parent cd7438d commit f0f1531faca68553012fd2ffe9153e0c7af76a79
Showing with 17 additions and 0 deletions.
  1. +17 −0 lib/Cake/Test/Case/Routing/RouterTest.php
@@ -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
*

0 comments on commit f0f1531

Please sign in to comment.
You can’t perform that action at this time.