ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
StructureFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
28 class StructureFactoryTest extends TestCase
29 {
30  public function testCreateElement(): void
31  {
32  $factory = new StructureFactory();
33  $struct = $factory->structure(new NullDefinition());
34 
35  $this->assertInstanceOf(StructureElement::class, $struct);
36  $this->assertFalse($struct->isRoot());
37  }
38 
39  public function testCreateRoot(): void
40  {
41  $factory = new StructureFactory();
42  $struct = $factory->root(new NullDefinition());
43 
44  $this->assertInstanceOf(StructureElementInterface::class, $struct);
45  $this->assertTrue($struct->isRoot());
46  }
47 
48  public function testCreateSet(): void
49  {
50  $factory = new StructureFactory();
51  $root = $factory->root(new NullDefinition());
52  $set = $factory->set($root);
53 
54  $this->assertInstanceOf(StructureSetInterface::class, $set);
55  }
56 }