mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added test case for a bug in Set::extract
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
9d3f2fb4a7
commit
e8e520d6f2
1 changed files with 14 additions and 0 deletions
|
@ -973,6 +973,20 @@ class SetTest extends CakeTestCase {
|
|||
$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.
|
||||
|
|
Loading…
Reference in a new issue