ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCtrlStructureReaderTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
29 {
34 
38  protected function setUp(): void
39  {
40  $this->expected_test_gui_structure = require __DIR__ . '/../Data/Structure/test_ctrl_structure.php';
41  }
42 
44  {
45  $class_map = require __DIR__ . '/../Data/ClassMaps/valid_class_map.php';
46  $reader = new ilCtrlStructureReader(
47  new ilCtrlArrayIterator($class_map),
49  );
50 
51  $this->assertFalse($reader->isExecuted());
52  $this->assertEquals(
53  $this->expected_test_gui_structure,
54  $reader->readStructure()
55  );
56 
57  $this->assertTrue($reader->isExecuted());
58  }
59 
61  {
62  $class_map = require __DIR__ . '/../Data/ClassMaps/invalid_class_map.php';
63  $reader = new ilCtrlStructureReader(
64  new ilCtrlArrayIterator($class_map),
66  );
67 
68  $this->assertFalse($reader->isExecuted());
69  $this->assertEmpty($reader->readStructure());
70  $this->assertTrue($reader->isExecuted());
71  }
72 
74  {
75  $reader = new ilCtrlStructureReader(
76  new ilCtrlArrayIterator([]),
78  );
79 
80  $this->assertFalse($reader->isExecuted());
81  $this->assertEmpty($reader->readStructure());
82  $this->assertTrue($reader->isExecuted());
83  }
84 }
Class ilCtrlStructureCidGenerator.
Class ilCtrlStructureReader is responsible for reading ilCtrl&#39;s control structure.
Class ilCtrlStructureReaderTest.
Class ilCtrlArrayIterator.