Adding sort() to option parsing, makes testing easier.

This commit is contained in:
mark_story 2009-03-28 00:31:08 -04:00
parent 9708b2dc50
commit 29b3a96cb2
2 changed files with 3 additions and 2 deletions

View file

@ -624,6 +624,7 @@ class JsBaseEngineHelper extends AppHelper {
}
$out[] = $key . ':' . $value;
}
sort($out);
return join(', ', $out);
}
/**

View file

@ -361,11 +361,11 @@ class JsBaseEngineTestCase extends CakeTestCase {
$JsEngine = new OptionEngineHelper();
$result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'key' => 1));
$expected = 'url:"/posts/view/1", key:1';
$expected = 'key:1, url:"/posts/view/1"';
$this->assertEqual($result, $expected);
$result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'success' => 'doSuccess'), array('success'));
$expected = 'url:"/posts/view/1", success:doSuccess';
$expected = 'success:doSuccess, url:"/posts/view/1"';
$this->assertEqual($result, $expected);
}
}