Added test for fetching arrays
This commit is contained in:
parent
95d997c79d
commit
699429ab08
|
@ -37,6 +37,15 @@ class JsonLDTest extends TestCase
|
|||
$this->assertNull($data);
|
||||
}
|
||||
|
||||
public function testFetchElementArrayFoundID()
|
||||
{
|
||||
$object = ['field' => ['value1', ['@id' => 'value2'], ['@id' => 'value3']]];
|
||||
|
||||
$data = JsonLD::fetchElementArray($object, 'field', '@id');
|
||||
$this->assertSame(['value1', 'value2', 'value3'], $data);
|
||||
}
|
||||
|
||||
|
||||
public function testFetchElementNotFound()
|
||||
{
|
||||
$object = [];
|
||||
|
|
Loading…
Reference in New Issue
Block a user