/** * @param $displayName string Runescape display name * @throws InvalidArgumentException */ public function __construct($displayName) { $this->common = new Common(); $this->api = new API(); if ($this->common->validateDisplayName($displayName) === false) { throw new InvalidDisplayNameException(); } $this->displayName = $displayName; }
public function testLevelToXp() { $api = new Common(); $this->assertEquals(0, $api->levelToXp(1)); $this->assertEquals(188884740, $api->levelToXp(126)); $this->assertEquals(13034431, $api->levelToXp(99)); $this->assertEquals(104273167, $api->levelToXp(120)); $this->assertEquals(200000000, $api->levelToXp(127)); }