public function testListWithParams()
 {
     $startTime = 1283846202;
     $endTime = 1283846202 + 1000;
     $this->client->shouldReceive('baseUrl')->once();
     $this->client->shouldReceive('request')->with('na/v2.2/matchlist/by-summoner/74602', ['api_key' => 'key', 'rankedQueues' => 'RANKED_SOLO_5x5', 'seasons' => 'SEASON2015', 'championIds' => '1,2,3', 'beginIndex' => 1, 'endIndex' => 4, 'beginTime' => $startTime, 'endTime' => $endTime])->once()->andReturn(file_get_contents('tests/Json/matchlist.74602.json'));
     $api = new Api('key', $this->client);
     $matchList = $api->matchlist()->matchlist(74602, 'RANKED_SOLO_5x5', 'SEASON2015', [1, 2, 3], 1, 4, $startTime, $endTime);
     $this->assertTrue($matchList->match(0) instanceof LeagueWrap\Dto\MatchReference);
 }
Example #2
0
<?php

require __DIR__ . '/vendor/autoload.php';
use LeagueWrap\Api;
$myKey = 'YOUR-DEVELOPER-RIOT-API-KEY';
$api = new Api($myKey);
$game = $api->game();
$games = $game->recent(74602);
$matchlistapi = $api->matchlist();
$matchlist = $matchlistapi->matchlist(74602);
$numberOfplayedGames = $matchlist->totalGames;
$roleInGame = $matchlist->match(0)->role;
print_r($matchlist);