Add test for #4309

The Router internals don't handle // which is good.
This commit is contained in:
mark_story 2014-08-24 12:12:52 +02:00
parent cd7438d33d
commit f0f1531fac

View file

@ -996,6 +996,23 @@ class RouterTest extends CakeTestCase {
$this->assertEquals('/admin/other/posts/index', $result); $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 * testUrlParsing method
* *