ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
MetaDataTest.php
Go to the documentation of this file.
1 <?php
2 
4 
11 
12 require_once('./libs/composer/vendor/autoload.php');
13 
19 class MetaDataTest extends TestCase
20 {
24  public $meta_content;
25 
26  protected function setUp() : void
27  {
28  parent::setUp();
29  $this->meta_content = new MetaContent('1.0');
30  }
31 
32  public function testAddMetaDatum() : void
33  {
34  $key = 'key';
35  $value = 'value';
36  $this->meta_content->addMetaDatum($key, $value);
37  $collection = $this->meta_content->getMetaData();
38 
39  $first_item = iterator_to_array($collection->getItems())[0];
40  $this->assertInstanceOf(MetaDatum::class, $first_item);
41  $this->assertEquals($key, $first_item->getKey());
42  $this->assertEquals($value, $first_item->getValue());
43  }
44 
45 }