ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCtrlStructureMapperTest Class Reference

Class ilCtrlStructureMapperTest. More...

+ Inheritance diagram for ilCtrlStructureMapperTest:
+ Collaboration diagram for ilCtrlStructureMapperTest:

Public Member Functions

 testStructureMapperWithEmptyArray ()
 
 testStructureMapperWithCommonStringArray ()
 
 testStructureMapperWithAssociativeStringArray ()
 
 testStructureMapperWithEmptyClassData ()
 
 testStructureMapperWithStructureArray ()
 
 testStructureMapperWithMissingReferenceLists ()
 
 testStructureMapperWithInvalidReferenceInList ()
 
 testStructureMapperReferenceListIndexesAfterInvalidReferenceIsRemoved ()
 
 testStructureMapperWithMixedArray ()
 

Detailed Description

Member Function Documentation

◆ testStructureMapperReferenceListIndexesAfterInvalidReferenceIsRemoved()

ilCtrlStructureMapperTest::testStructureMapperReferenceListIndexesAfterInvalidReferenceIsRemoved ( )

Definition at line 177 of file ilCtrlStructureMapperTest.php.

References ilCtrlStructureInterface\KEY_CLASS_CHILDREN, and ilCtrlStructureInterface\KEY_CLASS_PARENTS.

177  : void
178  {
179  $mapper = new ilCtrlStructureMapper([
180  'class1' => [
182  0 => 'class3',
183  1 => 'class2',
184  ],
185  ],
186  'class2' => [],
187  ]);
188 
189  $this->assertEquals(
190  [
191  'class1' => [
193  0 => 'class2',
194  ],
195  ],
196  'class2' => [
198  0 => 'class1',
199  ],
200  ],
201  ],
202  $mapper->getStructure()
203  );
204  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithAssociativeStringArray()

ilCtrlStructureMapperTest::testStructureMapperWithAssociativeStringArray ( )

Definition at line 44 of file ilCtrlStructureMapperTest.php.

44  : void
45  {
46  $mapper = new ilCtrlStructureMapper([
47  'key0' => 'entry0',
48  'key1' => 'entry1',
49  'key2' => 'entry2'
50  ]);
51 
52  $this->assertEmpty($mapper->getStructure());
53  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithCommonStringArray()

ilCtrlStructureMapperTest::testStructureMapperWithCommonStringArray ( )

Definition at line 36 of file ilCtrlStructureMapperTest.php.

36  : void
37  {
38  $expected_values = ['entry0', 'entry1', 'entry2'];
39  $mapper = new ilCtrlStructureMapper($expected_values);
40 
41  $this->assertEmpty($mapper->getStructure());
42  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithEmptyArray()

ilCtrlStructureMapperTest::testStructureMapperWithEmptyArray ( )

Definition at line 30 of file ilCtrlStructureMapperTest.php.

30  : void
31  {
32  $mapper = new ilCtrlStructureMapper([]);
33  $this->assertEmpty($mapper->getStructure());
34  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithEmptyClassData()

ilCtrlStructureMapperTest::testStructureMapperWithEmptyClassData ( )

Definition at line 55 of file ilCtrlStructureMapperTest.php.

55  : void
56  {
57  $expected_values = [
58  'key0' => [],
59  'key1' => [],
60  'key2' => []
61  ];
62 
63  $mapper = new ilCtrlStructureMapper($expected_values);
64 
65  $this->assertEquals(
66  $expected_values,
67  $mapper->getStructure()
68  );
69  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithInvalidReferenceInList()

ilCtrlStructureMapperTest::testStructureMapperWithInvalidReferenceInList ( )

Definition at line 157 of file ilCtrlStructureMapperTest.php.

References ilCtrlStructureInterface\KEY_CLASS_PARENTS.

157  : void
158  {
159  $mapper = new ilCtrlStructureMapper([
160  'class1' => [
162  'class2',
163  ],
164  ],
165  ]);
166 
167  $this->assertEquals(
168  [
169  'class1' => [
171  ]
172  ],
173  $mapper->getStructure()
174  );
175  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithMissingReferenceLists()

ilCtrlStructureMapperTest::testStructureMapperWithMissingReferenceLists ( )

Definition at line 118 of file ilCtrlStructureMapperTest.php.

References ilCtrlStructureInterface\KEY_CLASS_CHILDREN, and ilCtrlStructureInterface\KEY_CLASS_PARENTS.

118  : void
119  {
120  $mapper = new ilCtrlStructureMapper([
121  'class0' => [
123  'class1',
124  ],
125  ],
126  'class1' => [
128  'class2',
129  ],
130  ],
131  'class2' => []
132  ]);
133 
134  $this->assertEquals(
135  [
136  'class0' => [
138  'class1',
139  ],
140  ],
141  'class1' => [
143  'class2',
144  'class0',
145  ],
146  ],
147  'class2' => [
149  'class1',
150  ],
151  ]
152  ],
153  $mapper->getStructure()
154  );
155  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithMixedArray()

ilCtrlStructureMapperTest::testStructureMapperWithMixedArray ( )

Definition at line 206 of file ilCtrlStructureMapperTest.php.

References ilCtrlStructureInterface\KEY_CLASS_CHILDREN, and ilCtrlStructureInterface\KEY_CLASS_PARENTS.

206  : void
207  {
208  $mapper = new ilCtrlStructureMapper([
209  'class1' => [],
210  'class2' => false,
211  3 => [
213  'class1',
214  ],
215  ],
216  'class3' => [
218  'class1',
219  'class2',
220  ],
221  ],
222  'class4' => [
224  3
225  ],
226  ],
227  ]);
228 
229  $this->assertEquals(
230  [
231  'class1' => [
233  'class3',
234  ],
235  ],
236  'class3' => [
238  'class1',
239  ],
240  ],
241  'class4' => [
243  ],
244  ],
245  $mapper->getStructure()
246  );
247  }
Class ilCtrlStructureMapper.

◆ testStructureMapperWithStructureArray()

ilCtrlStructureMapperTest::testStructureMapperWithStructureArray ( )

Definition at line 71 of file ilCtrlStructureMapperTest.php.

References ilCtrlStructureInterface\KEY_CLASS_CHILDREN, and ilCtrlStructureInterface\KEY_CLASS_PARENTS.

71  : void
72  {
73  $mapper = new ilCtrlStructureMapper([
74  'class0' => [
76  'class1',
77  ],
79  ],
80  'class1' => [
83  'class2',
84  ],
85  ],
86  'class2' => [
89  ]
90  ]);
91 
92  $this->assertEquals(
93  [
94  'class0' => [
96  'class1',
97  ],
99  ],
100  'class1' => [
103  'class2',
104  'class0',
105  ],
106  ],
107  'class2' => [
109  'class1',
110  ],
112  ]
113  ],
114  $mapper->getStructure()
115  );
116  }
Class ilCtrlStructureMapper.

The documentation for this class was generated from the following file: