Two more tests

This commit is contained in:
Michael 2020-06-07 08:24:08 +00:00
parent 775437cb1c
commit 1f36c655e1

View File

@ -114,6 +114,22 @@ class JsonLDTest extends TestCase
$this->assertSame('body', $data);
}
public function testFetchElementTypeNotFound()
{
$object = ['source' => ['content' => 'body', 'mediaType' => 'text/html']];
$data = JsonLD::fetchElement($object, 'source', 'content', 'mediaType', 'text/bbcode');
$this->assertNull($data);
}
public function testFetchElementTypeWithoutType()
{
$object = ['source' => ['content' => 'body', 'mediaType' => 'text/bbcode']];
$data = JsonLD::fetchElement($object, 'source', 'content');
$this->assertSame('body', $data);
}
public function testFetchElementTypeArray()
{
$object = ['source' => [['content' => 'body2', 'mediaType' => 'text/html'],