ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StructureFactoryTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
27
28class 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}