Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 29b3a96cb2a53a9fe0fc006ecd790cb2515a09db 1 parent 9708b2d
@markstory markstory authored
View
1  cake/libs/view/helpers/js.php
@@ -624,6 +624,7 @@ function _parseOptions($options, $safeKeys = array()) {
}
$out[] = $key . ':' . $value;
}
+ sort($out);
return join(', ', $out);
}
/**
View
4 cake/tests/cases/libs/view/helpers/js.test.php
@@ -361,11 +361,11 @@ function testOptionParsing() {
$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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.