forked from kevinohashi/php-riot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.php
40 lines (34 loc) · 1.11 KB
/
testing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include('php-riot-api.php');
include('FileSystemCache.php');
//testing classes
//using double quotes seems to make all names work (see issue: https://github.com/kevinohashi/php-riot-api/issues/33)
$summoner_name = "RiotSchmick";
$summoner_id = 585897;
$test = new riotapi('na');
$testCache = new riotapi('na', new FileSystemCache('cache/'));
//$r = $test->getSummonerByName($summoner_name);
//$r = $test->getSummoner($summoner_id);
//$r = $test->getSummoner($summoner_id,'masteries');
//$r = $test->getSummoner($summoner_id,'runes');
//$r = $test->getSummoner($summoner_id,'name');
//$r = $test->getStats($summoner_id);
//$r = $test->getStats($summoner_id,'ranked');
//$r = $test->getTeam($summoner_id);
//$r = $test->getLeague($summoner_id);
//$r = $test->getGame($summoner_id);
//$r = $test->getChampion();
try {
$r = $test->getSummonerByName($summoner_name);
print_r($r);
} catch(Exception $e) {
echo "Error: " . $e->getMessage();
};
echo "<br>\r\n testing cache:";
try {
$r = $testCache->getSummoner($summoner_id);
print_r($r);
} catch(Exception $e) {
echo "Error: " . $e->getMessage();
};
?>