Skip to content

Commit

Permalink
Skip schedule integration tests at the beginning and ending of a season
Browse files Browse the repository at this point in the history
  • Loading branch information
nkl-kst committed May 30, 2021
1 parent 070ed0a commit dc48b24
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- League serializer should handle `null` response if ID was not found
- Event serializer should handle `null` response if ID was not found
- Skip schedule tests at the beginning and ending of the season

## [1.0.1] - 2021-05-04

Expand Down
21 changes: 21 additions & 0 deletions test/integration/ScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function testTeamNext(): void
$events = $this->client->schedule()->teamNext(133602);
$this->assertContainsOnlyInstancesOf(Event::class, $events);

// There are no events to check at the ending of a season
if (empty($events)) {
$this->markTestSkipped('No events to check');
}

$event = $events[0];
$this->assertTrue('Liverpool' === $event->strHomeTeam || 'Liverpool' === $event->strAwayTeam);
}
Expand All @@ -47,6 +52,11 @@ public function testLeagueNext(): void
TestUtils::setPatreonKey($this->client);
$events = $this->client->schedule()->leagueNext(4328);

// There are no events to check at the ending of a season
if (empty($events)) {
$this->markTestSkipped('No events to check');
}

$this->assertContainsOnlyInstancesOf(Event::class, $events);
$this->assertSame('English Premier League', $events[0]->strLeague);
}
Expand All @@ -61,6 +71,11 @@ public function testTeamLast(): void
$events = $this->client->schedule()->teamLast(133602);
$this->assertContainsOnlyInstancesOf(Event::class, $events);

// There are no events to check at the beginning of a season
if (empty($events)) {
$this->markTestSkipped('No events to check');
}

$event = $events[0];
$this->assertTrue('Liverpool' === $event->strHomeTeam || 'Liverpool' === $event->strAwayTeam);
}
Expand All @@ -73,6 +88,12 @@ public function testTeamLast(): void
public function testLeagueLast(): void
{
$events = $this->client->schedule()->leagueLast(4328);

// There are no events to check at the beginning of a season
if (empty($events)) {
$this->markTestSkipped('No events to check');
}

$this->assertContainsOnlyInstancesOf(Event::class, $events);
$this->assertSame('English Premier League', $events[0]->strLeague);
}
Expand Down

0 comments on commit dc48b24

Please sign in to comment.