Skip to content

Commit

Permalink
Adding tests for passed arguments with dots when parseExtensions() ha…
Browse files Browse the repository at this point in the history
…s been called. Refs #620
  • Loading branch information
markstory committed Apr 25, 2010
1 parent d9f7b9b commit ba19e0a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cake/tests/cases/libs/router.test.php
Expand Up @@ -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
*
Expand Down

0 comments on commit ba19e0a

Please sign in to comment.