mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:02:54 +00:00
The more tests the better?
This commit is contained in:
parent
bc616a142b
commit
8868bc3b55
1 changed files with 18 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue