Skip to content
Permalink
Browse files

Added test case for a bug in Set::extract

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
Jimmy Bourassa authored and markstory committed Mar 17, 2010
1 parent 9d3f2fb commit e8e520d6f2114b2e954299ca95e7360f4d191535
Showing with 14 additions and 0 deletions.
  1. +14 −0 cake/tests/cases/libs/set.test.php
@@ -973,6 +973,20 @@ function testExtract() {
$result = Set::extract('/ParentNode/name', $hasMany);
$expected = array('Second');
$this->assertEqual($result, $expected);
$startingAtOne = array(
'Article' => array(
1=> array(
'id' => 1,
'approved' => 1,
),
)
);
$expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1)));
$result = Set::extract('/Article[approved=1]', $startingAtOne);
$this->assertEqual($result, $expected);
}
/**
* test that extract() still works when arrays don't contain a 0 index.

0 comments on commit e8e520d

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.