예제 #1
0
 public function testCurrentGameParticipantRunes()
 {
     $this->client->shouldReceive('baseUrl')->once();
     $this->client->shouldReceive('request')->with('consumer/getSpectatorGameInfo/EUW1/30447079', ['api_key' => 'key'])->once()->andReturn(file_get_contents('tests/Json/currentgame.30447079.json'));
     $api = new Api('key', $this->client);
     $api->setRegion('euw');
     $game = $api->currentGame()->currentGame(30447079);
     $participant = $game->participant(28882300);
     $this->assertTrue($participant->rune(5253) instanceof \LeagueWrap\Dto\Rune);
     $this->assertTrue($participant->rune(5253)->count == 9);
 }
예제 #2
0
 public function testCurrentGame()
 {
     $api = new Api('key');
     $currentGame = $api->currentGame();
     $this->assertTrue($currentGame instanceof LeagueWrap\Api\CurrentGame);
 }
예제 #3
0
 public function testAttachStaticData()
 {
     $this->client->shouldReceive('baseUrl')->with('https://euw.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/EUW1/')->once();
     $this->client->shouldReceive('baseUrl')->with('https://global.api.pvp.net/api/lol/static-data/')->times(4);
     $this->client->shouldReceive('request')->with('30447079', ['api_key' => 'key'])->once()->andReturn(file_get_contents('tests/Json/currentgame.30447079.json'));
     $this->client->shouldReceive('request')->with('v1.2/champion', ['api_key' => 'key', 'dataById' => 'true'])->once()->andReturn(file_get_contents('tests/Json/Static/champion.euw.json'));
     $this->client->shouldReceive('request')->with('v1.2/summoner-spell', ['api_key' => 'key', 'dataById' => 'true'])->once()->andReturn(file_get_contents('tests/Json/Static/summonerspell.euw.json'));
     $this->client->shouldReceive('request')->with('v1.2/mastery', ['api_key' => 'key'])->once()->andReturn(file_get_contents('tests/Json/Static/mastery.euw.json'));
     $this->client->shouldReceive('request')->with('v1.2/rune', ['api_key' => 'key'])->once()->andReturn(file_get_contents('tests/Json/Static/rune.euw.json'));
     $api = new Api('key', $this->client);
     $api->setRegion('euw');
     $api->attachStaticData(true);
     $game = $api->currentGame()->currentGame(30447079);
     $participant = $game->participant(28882300);
     $rune = $participant->rune(5253);
     $this->assertTrue($rune->runeStaticData instanceof LeagueWrap\Dto\StaticData\Rune);
     $masteries = $participant->masteries;
     $this->assertTrue($masteries[6111]->masteryStaticData instanceof LeagueWrap\Dto\StaticData\Mastery);
 }