| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function testLeague() |
||
| 14 | { |
||
| 15 | $data = file_get_contents(__DIR__ . '/data/league.json'); |
||
| 16 | $response = new GuzzleHttp\Psr7\Response(200, [], $data); |
||
| 17 | $mock = new GuzzleHttp\Handler\MockHandler([ $response, $response ]); |
||
| 18 | |||
| 19 | $client = new Sleeper($mock); |
||
| 20 | |||
| 21 | $league = (object) $client->leagues()->find('289646328504385536'); |
||
|
|
|||
| 22 | |||
| 23 | $this->assertIsObject($league); |
||
| 24 | $this->assertEquals('289646328504385536', $league->league_id); |
||
| 25 | $this->assertEquals('Sleeper Friends League', $league->name); |
||
| 26 | $this->assertEquals('2018', $league->season); |
||
| 27 | $this->assertCount(15, $league->roster_positions); |
||
| 28 | $this->assertIsArray($league->settings); |
||
| 29 | } |
||
| 32 |