ILIAS  release_8 Revision v8.24
ilCtrlStructureHelperTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2021 Thibeau Fuhrer <thf@studer-raimann.ch> Extended GPL, see docs/LICENSE */
6
7use PHPUnit\Framework\TestCase;
8
13class ilCtrlStructureHelperTest extends TestCase
14{
15 public function testStructureHelperWithEmptyArrays(): void
16 {
17 $helper = new ilCtrlStructureHelper([], []);
18
19 $this->assertEmpty($helper->getStructure());
20 }
21
23 {
24 $expected_value = ['entry0'];
25 $helper = new ilCtrlStructureHelper([], $expected_value);
26
27 $this->assertEquals($expected_value, $helper->getStructure());
28 }
29
31 {
32 $helper = new ilCtrlStructureHelper(
33 [
34 'baseclass1',
35 ],
36 [
37 'baseclass1' => [],
38 'unnecessary_class1' => [],
39 'unnecessary_class2' => [
42 ],
43 'command_class_1' => [
46 'baseclass1',
47 ],
48 ],
49 ]
50 );
51
52 $this->assertEquals(
53 [
54 'baseclass1' => [],
55 'command_class_1' => [
58 'baseclass1',
59 ],
60 ],
61 ],
62 $helper->filterUnnecessaryEntries()->getStructure()
63 );
64 }
65}
Class ilCtrlStructureHelperTest.
Class ilCtrlStructureHelper.