mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
ticket #989 test case added
This commit is contained in:
parent
7812223eb5
commit
03ffa3d152
1 changed files with 34 additions and 0 deletions
|
@ -939,6 +939,40 @@ class SetTest extends CakeTestCase {
|
|||
$result = Set::extract('/ParentNode/name', $hasMany);
|
||||
$expected = array('Second');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$data = array(
|
||||
array(
|
||||
'Category' => array(
|
||||
'id' => 1,
|
||||
'name' => 'First'
|
||||
),
|
||||
0 => array(
|
||||
'value' => 50
|
||||
)
|
||||
),
|
||||
array(
|
||||
'Category' => array(
|
||||
'id' => 2,
|
||||
'name' => 'Second'
|
||||
),
|
||||
0 => array(
|
||||
'value' => 60
|
||||
)
|
||||
)
|
||||
);
|
||||
$expected = array(
|
||||
array(
|
||||
'Category' => array(
|
||||
'id' => 1,
|
||||
'name' => 'First'
|
||||
),
|
||||
0 => array(
|
||||
'value' => 50
|
||||
)
|
||||
)
|
||||
);
|
||||
$result = Set::extract('/Category[id=1]/..', $data);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue