ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ScaffoldFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
35 
36 class 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 }