]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Util/JSonLDTest.php
The more tests the better?
[friendica.git] / tests / src / Util / JSonLDTest.php
index 8fff9dee3de139a8e12ecc6b652bd7b23532ac9f..41fb93bbe345e37f937c88eddc915034f417fdd6 100644 (file)
@@ -146,4 +146,22 @@ class JsonLDTest extends TestCase
                $data = JsonLD::fetchElement($object, 'source', 'content', 'mediaType', 'text/bbcode');
                $this->assertSame('body', $data);
        }
+
+       public function testFetchElementTypeValueArrayNotFound()
+       {
+               $object = ['source' => [['content' => 'body2', 'mediaType' => 'text/html'],
+                       ['content' => 'body', 'mediaType' => 'text/bbcode']]];
+
+               $data = JsonLD::fetchElement($object, 'source', 'content', 'mediaType', 'text/markdown');
+               $this->assertNull($data);
+       }
+
+       public function testFetchElementTypeArrayNotFound()
+       {
+               $object = ['source' => [['content' => 'body2', 'mediaType' => 'text/html'],
+                       ['content' => 'body', 'mediaType' => 'text/bbcode']]];
+
+               $data = JsonLD::fetchElement($object, 'source', 'content', 'mediaType2', 'text/bbcode');
+               $this->assertNull($data);
+       }
 }