ILIAS  release_8 Revision v8.24
MetaDataTest.php
Go to the documentation of this file.
1<?php
2
4
5use PHPUnit\Framework\TestCase;
8
9require_once('./libs/composer/vendor/autoload.php');
10
16class MetaDataTest extends TestCase
17{
19
20 protected function setUp(): void
21 {
22 parent::setUp();
23 $this->meta_content = new MetaContent('1.0');
24 }
25
26 public function testAddMetaDatum(): void
27 {
28 $key = 'key';
29 $value = 'value';
30 $this->meta_content->addMetaDatum($key, $value);
31 $collection = $this->meta_content->getMetaData();
32
33 $first_item = iterator_to_array($collection->getItems())[0];
34 $this->assertInstanceOf(MetaDatum::class, $first_item);
35 $this->assertEquals($key, $first_item->getKey());
36 $this->assertEquals($value, $first_item->getValue());
37 }
38}
@noinspection PhpIncompatibleReturnTypeInspection
string $key
Consumer key/client ID value.
Definition: System.php:193