/**
  * @param $mockData
  * @dataProvider extractDataProvider
  */
 public function testExtract($mockData)
 {
     $result = PositionParsingService::extract($mockData);
     $joinDate = new \DateTime();
     $joinDate->setTimestamp($mockData['joinTimestamp']);
     $this->assertEquals($joinDate, $result->getJoinDate());
     $this->assertEquals($mockData['points'], $result->getPoints());
     $this->assertEquals($mockData['wins'], $result->getWins());
     $this->assertEquals($mockData['losses'], $result->getLosses());
     $this->assertEquals($mockData['highestRank'], $result->getHighestRank());
     $this->assertEquals($mockData['previousRank'], $result->getPreviousRank());
     if (isset($mockData['favoriteRaceP1'])) {
         $this->assertEquals($mockData['favoriteRaceP1'], $result->getFavoriteRaceP1());
     } else {
         $this->assertNull($result->getFavoriteRaceP1());
     }
     $this->assertEquals($mockData['character']['id'], $result->getCharacter()->getId());
     $this->assertEquals($mockData['character']['realm'], $result->getCharacter()->getRealm());
     $this->assertEquals($mockData['character']['displayName'], $result->getCharacter()->getDisplayName());
     $this->assertEquals($mockData['character']['clanName'], $result->getCharacter()->getClanName());
     $this->assertEquals($mockData['character']['clanTag'], $result->getCharacter()->getClanTag());
     $this->assertEquals($mockData['character']['profilePath'], $result->getCharacter()->getProfilePath());
 }
 /**
  * Customisable league method, try using the wrapper methods first.
  *
  * @param string $region The region where the request should be made. Please use the Region class for consistency with future releases.
  * @param array $parameters The parameters that should be passed to the league API method.
  * @return array Array containing all of the ladder members as LadderPosition instances.
  */
 protected function getLeagueInformationWrapper($region, $parameters)
 {
     $apiData = $this->makeCall($region, self::API_LADDER_METHOD, $parameters, false);
     $ladderMembers = array();
     foreach ($apiData['ladderMembers'] as $member) {
         $ladderMembers[] = Parsing\Ladder\PositionParsingService::extract($member);
     }
     return $ladderMembers;
 }