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