Commits

Norbert Nemetvolgyi  committed 9794a20

added level id conversion

  • Participants
  • Parent commits 3a662f5

Comments (0)

Files changed (2)

File src/ActivityID.php

         $hotSpotStr = self::getHotSpotStr($activityID);
         $topicStr = self::getTopicStr($activityID);
 
-        return "L01" . $topicStr . $hotSpotStr;
+        return "L0" . strval(floor((int)$activityID / 60) + 1) . $topicStr . $hotSpotStr;
     }
 
     /**

File srcTest/ActivityIDTest.php

         $actual = substr(ActivityID::toString(61), 3);
         $this->assertEquals("M0101", $actual);
     }
+
+    public function testMethod_getActivityString_handlesLevelNumberCorrectlyForInt_61()
+    {
+        $actual = ActivityID::toString(61);
+        $this->assertEquals("L02M0101", $actual);
+    }
 }