Adding fix for Set::extract() when only grabbing numeric keys

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5652 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-09-16 18:22:17 +00:00
parent 1791a378c0
commit 02494a0519
2 changed files with 14 additions and 1 deletions

View file

@ -38,6 +38,12 @@ uses('set');
*/
class SetTest extends UnitTestCase {
function testNumericKeyExtraction() {
$data = array('plugin' => null, 'controller' => '', 'action' => '', 1, 'whatever');
$this->assertIdentical(Set::extract($data, '{n}'), array(1, 'whatever'));
$this->assertIdentical(Set::diff($data, Set::extract($data, '{n}')), array('plugin' => null, 'controller' => '', 'action' => ''));
}
function testMerge() {
// Test that passing in just 1 array returns it "as-is"
$r = Set::merge(array('foo'));