X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fsrc%2FUtil%2FJSonLDTest.php;h=94c7952b5caa28d8e055b0d5e9aa114f42b27336;hb=31c55a6fa45f0acd8ef9ff1ef86224778d614819;hp=41fb93bbe345e37f937c88eddc915034f417fdd6;hpb=8868bc3b5590ae5516603f328e06d5e752e86920;p=friendica.git diff --git a/tests/src/Util/JSonLDTest.php b/tests/src/Util/JSonLDTest.php index 41fb93bbe3..94c7952b5c 100644 --- a/tests/src/Util/JSonLDTest.php +++ b/tests/src/Util/JSonLDTest.php @@ -98,6 +98,14 @@ class JsonLDTest extends TestCase $this->assertSame('', $data); } + public function testFetchElementKeyFoundEmptyArray() + { + $object = ['field' => ['content' => []]]; + + $data = JsonLD::fetchElement($object, 'field', 'content'); + $this->assertSame([], $data); + } + public function testFetchElementFoundID() { $object = ['field' => ['field2' => 'value2', '@id' => 'value', 'field3' => 'value3']]; @@ -130,7 +138,7 @@ class JsonLDTest extends TestCase $this->assertNull($data); } - public function testFetchElementTypeWithoutType() + public function testFetchElementKeyWithoutType() { $object = ['source' => ['content' => 'body', 'mediaType' => 'text/bbcode']];