ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ScaffoldFactoryTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
35
36class ScaffoldFactoryTest extends TestCase
37{
38 public function testCreateScaffold(): void
39 {
40 $factory = new ScaffoldFactory(
41 new NullDataFactory(),
43 );
44 $scaffold = $factory->scaffold(new NullDefinition());
45
46 $this->assertInstanceOf(ElementInterface::class, $scaffold);
47 $this->assertSame(NoID::SCAFFOLD, $scaffold->getMDID());
48 $this->assertSame(Type::NULL, $scaffold->getData()->type());
49 }
50
51 public function testCreateSet(): void
52 {
53 $factory = new ScaffoldFactory(
54 new NullDataFactory(),
56 );
57
58 $root_definition = new NullDefinition();
59 $set = $factory->set($root_definition);
60
61 $this->assertInstanceOf(SetInterface::class, $set);
62 $this->assertInstanceOf(NullRessourceID::class, $set->getRessourceID());
63 }
64}