ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCtrlStructureHelperTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
27class ilCtrlStructureHelperTest extends TestCase
28{
29 public function testStructureHelperWithEmptyArrays(): void
30 {
31 $helper = new ilCtrlStructureHelper([], []);
32
33 $this->assertEmpty($helper->getStructure());
34 }
35
37 {
38 $expected_value = ['entry0'];
39 $helper = new ilCtrlStructureHelper([], $expected_value);
40
41 $this->assertEquals($expected_value, $helper->getStructure());
42 }
43
45 {
46 $helper = new ilCtrlStructureHelper(
47 [
48 'baseclass1',
49 ],
50 [
51 'baseclass1' => [],
52 'unnecessary_class1' => [],
53 'unnecessary_class2' => [
56 ],
57 'command_class_1' => [
60 'baseclass1',
61 ],
62 ],
63 ]
64 );
65
66 $this->assertEquals(
67 [
68 'baseclass1' => [],
69 'command_class_1' => [
72 'baseclass1',
73 ],
74 ],
75 ],
76 $helper->filterUnnecessaryEntries()->getStructure()
77 );
78 }
79}
Class ilCtrlStructureHelperTest.
Class ilCtrlStructureHelper.