Merge pull request #9526 from MrPetovan/bug/9525-mastodon-emojis-tag
Restore expected implementation of JsonLD::fetchElementArray
This commit is contained in:
commit
acae3df0a2
4 changed files with 31 additions and 10 deletions
|
@ -62,6 +62,7 @@ class JsonLDTest extends TestCase
|
|||
$data = JsonLD::fetchElementArray($object, 'field', '@id');
|
||||
self::assertSame(['value3', 'value4'], $data);
|
||||
}
|
||||
|
||||
public function testFetchElementArrayFoundArrays()
|
||||
{
|
||||
$object = ['field' => [['subfield11' => 'value11', 'subfield12' => 'value12'],
|
||||
|
@ -74,6 +75,17 @@ class JsonLDTest extends TestCase
|
|||
self::assertSame($expect, $data);
|
||||
}
|
||||
|
||||
public function testFetchElementArrayTypeValue()
|
||||
{
|
||||
$object = ['field' => [['subfield11' => 'value11', 'subfield12' => 'value12'],
|
||||
['subfield21' => 'value21', 'subfield22' => 'value22']]];
|
||||
|
||||
$expect = [['subfield11' => 'value11', 'subfield12' => 'value12']];
|
||||
|
||||
$data = JsonLD::fetchElementArray($object, 'field', null, 'subfield11', 'value11');
|
||||
self::assertSame($expect, $data);
|
||||
}
|
||||
|
||||
public function testFetchElementNotFound()
|
||||
{
|
||||
$object = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue