/** * Extract season entry information from an array. * * @param array $params The parameters with the API response where the data should be extracted from. * @return Object containing season information. */ public static function extract($params) { $seasonEntry = new Entry(); $ladderInformationArray = self::extractLadderInformationData($params); $characters = self::extractCharacterData($params); $nonRankedArray = self::extractNonRankedLadderData($params); $seasonEntry->setLadderInformation($ladderInformationArray)->setCharacters($characters)->setNonRanked($nonRankedArray); return $seasonEntry; }
/** * @param Entity\Season\Entry $currentSeasonEntry */ protected function assertPlayerLaddersCurrentSeason($currentSeasonEntry) { /** * @var $ladderInformation Entity\Ladder\Information * @var $characterInformation Entity\Player\Basic * @var $nonRanked array */ $temp = $currentSeasonEntry->getLadderInformation(); $ladderInformation = $temp[0]; $this->assertEquals("Archon Kappa", $ladderInformation->getLadderName()); $this->assertEquals(152724, $ladderInformation->getLadderId()); $this->assertEquals(124, $ladderInformation->getDivision()); $this->assertEquals(77, $ladderInformation->getRank()); $this->assertEquals("SILVER", $ladderInformation->getLeague()); $this->assertEquals("HOTS_TWOS", $ladderInformation->getMatchMakingQueue()); $this->assertEquals(4, $ladderInformation->getWins()); $this->assertEquals(6, $ladderInformation->getLosses()); $this->assertTrue($ladderInformation->getShowcase()); $temp = $currentSeasonEntry->getCharacters(); $characterInformation = $temp[1]; $this->assertEquals(3690427, $characterInformation->getId()); $this->assertEquals(1, $characterInformation->getRealm()); $this->assertEquals("Kodran", $characterInformation->getDisplayName()); $this->assertEquals("Cegeka Guild", $characterInformation->getClanName()); $this->assertEquals("CGK", $characterInformation->getClanTag()); $this->assertEquals("/profile/3690427/1/Kodran/", $characterInformation->getProfilePath()); $nonRanked = $currentSeasonEntry->getNonRanked(); $this->assertInternalType('array', $nonRanked); $this->assertCount(0, $nonRanked); }