/** * Get rankings for specific location * @param $locationId * @param $rankingId * @return array */ public function getRankingsForLocation($locationId, $rankingId) { $url = 'locations/' . $locationId . '/rankings/' . $rankingId; if ($rankingId == 'clans') { return array_map(function ($item) { return Clan::makeFromArray($item); }, $this->request($url)['items']); } return array_map(function ($item) { return Player::makeFromArray($item); }, $this->request($url)['items']); }
public function testItCastsPropertiesProperly() { $this->assertInstanceOf(League::class, $this->player->league()); $this->assertEquals('Champions League III', $this->player->league()->name()); }