From 8868bc3b5590ae5516603f328e06d5e752e86920 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 Jun 2020 08:39:00 +0000 Subject: [PATCH] The more tests the better? --- tests/src/Util/JSonLDTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/src/Util/JSonLDTest.php b/tests/src/Util/JSonLDTest.php index 8fff9dee3d..41fb93bbe3 100644 --- a/tests/src/Util/JSonLDTest.php +++ b/tests/src/Util/JSonLDTest.php @@ -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); + } }