|
@@ -964,7 +964,7 @@ class HashTest extends TestCase
|
|
|
|
|
|
|
|
$data = new ArrayObject([
|
|
$data = new ArrayObject([
|
|
|
'User' => new ArrayObject([
|
|
'User' => new ArrayObject([
|
|
|
- 0 => new ArrayObject([
|
|
|
|
|
|
|
+ 0 => new Entity([
|
|
|
'id' => 4,
|
|
'id' => 4,
|
|
|
'name' => 'Neo'
|
|
'name' => 'Neo'
|
|
|
]),
|
|
]),
|
|
@@ -979,6 +979,19 @@ class HashTest extends TestCase
|
|
|
]);
|
|
]);
|
|
|
$result = Hash::extract($data, 'User.{n}.name');
|
|
$result = Hash::extract($data, 'User.{n}.name');
|
|
|
$this->assertEquals($expected, $result);
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
+
|
|
|
|
|
+ $data = [
|
|
|
|
|
+ 0 => new Entity([
|
|
|
|
|
+ 'id' => 4,
|
|
|
|
|
+ 'name' => 'Neo'
|
|
|
|
|
+ ]),
|
|
|
|
|
+ 'stringKey' => new ArrayObject([
|
|
|
|
|
+ 'name' => 'Fail'
|
|
|
|
|
+ ])
|
|
|
|
|
+ ];
|
|
|
|
|
+ $result = Hash::extract($data, '{n}.name');
|
|
|
|
|
+ $expected = ['Neo'];
|
|
|
|
|
+ $this->assertEquals($expected, $result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|