Browse Source

testGetFlatTree : test de l'ordre

frederic 2 years ago
parent
commit
52806b321f
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      Tests/LearningModels/SCORM2004/DOMSCORM2004Test.php

+ 13
- 0
Tests/LearningModels/SCORM2004/DOMSCORM2004Test.php View File

@@ -160,8 +160,21 @@ class DOMSCORM2004Test extends TestCase
160 160
 
161 161
         $flat = $dom->getFlatTree('T-01b'); // noeud racine
162 162
         $this->assertSame(43, sizeof($flat));
163
+        $expected = array('T-01b' => 0);
164
+        for ($i=1; $i<=42; $i++) {
165
+            $expected['activity_'.$i]= $i;
166
+        }
167
+        $this->assertSame($expected, $flat);
168
+
163 169
         $flat = $dom->getFlatTree('activity_4'); // sous arbre
170
+
164 171
         $this->assertSame(4, sizeof($flat));
172
+        $this->assertSame([
173
+            'activity_4' => 0,
174
+            'activity_5' => 1,
175
+            'activity_6' => 2,
176
+            'activity_7' => 3,
177
+        ], $flat);
165 178
     }
166 179
 
167 180
     public function testGetSequencingAttribute()

Loading…
Cancel
Save