diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 409ef9e7bcc..ce332156228 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1502,6 +1502,22 @@ function testPagesUrlParsing() { $expected = array('pass'=>array('contact'), 'named' => array(), 'plugin'=> null, 'controller'=>'pages', 'action'=>'display'); $this->assertEqual($result, $expected); } +/** + * test that requests with a trailing dot don't loose the do. + * + * @return void + */ + function testParsingWithTrailingPeriodAndParseExtensions() { + Router::reload(); + Router::parseExtensions('json'); + + $result = Router::parse('/posts/view/something.'); + $this->assertEqual($result['pass'][0], 'something.', 'Period was chopped off %s'); + + $result = Router::parse('/posts/view/something. . .'); + $this->assertEqual($result['pass'][0], 'something. . .', 'Period was chopped off %s'); + } + /** * testParsingWithPrefixes method *