]> git.mxchange.org Git - friendica.git/commitdiff
Added test for fetching arrays
authorMichael <heluecht@pirati.ca>
Sat, 6 Jun 2020 14:16:27 +0000 (14:16 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 6 Jun 2020 14:16:27 +0000 (14:16 +0000)
tests/src/Util/JSonLDTest.php

index 1cb1bb1f9b890a70318ea9a9c8045ee320de324d..617e771f4997427d1765ab832f78d85a1dd25232 100644 (file)
@@ -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 = [];