]> git.mxchange.org Git - friendica.git/commitdiff
Another test added
authorMichael <heluecht@pirati.ca>
Sun, 7 Jun 2020 08:15:04 +0000 (08:15 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 7 Jun 2020 08:15:04 +0000 (08:15 +0000)
tests/src/Util/JSonLDTest.php

index 969a04759c64830fb8a9bed3d64421b4817262c7..a8d4467f5ffbdbf93bf000afe44ad2189eab6669 100644 (file)
@@ -53,6 +53,15 @@ class JsonLDTest extends TestCase
                $this->assertSame(['value1', 'value2', 'value3'], $data);
        }
 
+       public function testFetchElementArrayFoundID2()
+       {
+               $object = ['field' => [['subfield11' => 'value11', 'subfield12' => 'value12'],
+                       ['subfield21' => 'value21', 'subfield22' => 'value22'],
+                       'value3', ['@id' => 'value4', 'subfield42' => 'value42']]];
+
+               $data = JsonLD::fetchElementArray($object, 'field', '@id');
+               $this->assertSame(['value3', 'value4'], $data);
+       }
        public function testFetchElementArrayFoundArrays()
        {
                $object = ['field' => [['subfield11' => 'value11', 'subfield12' => 'value12'],