ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
FactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\MetaData\Elements;
22 
32 
33 class FactoryTest extends TestCase
34 {
35  public function testCreateElement(): void
36  {
37  $factory = new Factory(new NullDataFactory());
38  $el = $factory->element(13, new NullDefinition(), 'value');
39 
40  $this->assertInstanceOf(Element::class, $el);
41  $this->assertFalse($el->isRoot());
42  $this->assertFalse($el->isScaffold());
43  }
44 
45  public function testCreateRoot(): void
46  {
47  $factory = new Factory(new NullDataFactory());
48  $root = $factory->root(new NullDefinition());
49 
50  $this->assertInstanceOf(ElementInterface::class, $root);
51  $this->assertTrue($root->isRoot());
52  $this->assertFalse($root->isScaffold());
53  }
54 
55  public function testCreateSet(): void
56  {
57  $factory = new Factory(new NullDataFactory());
58  $root = $factory->root(new NullDefinition());
59  $set = $factory->set(new NullRessourceID(), $root);
60 
61  $this->assertInstanceOf(SetInterface::class, $set);
62  }
63 }