diff --git a/src/Events/Event.php b/src/Events/Event.php index 17e79de..3dba178 100644 --- a/src/Events/Event.php +++ b/src/Events/Event.php @@ -54,6 +54,26 @@ class Event */ public $socialDistancingRulesetKey; + /** + * @var string + */ + public $topLevelSeasonKey; + + /** + * @var bool + */ + public $isTopLevelSeason; + + /** + * @var bool + */ + public $isPartialSeason; + + /** + * @var bool + */ + public $isEventInSeason; + public function isSeason() { return false; } diff --git a/tests/Events/RetrieveEventTest.php b/tests/Events/RetrieveEventTest.php index b2d4a03..2523110 100644 --- a/tests/Events/RetrieveEventTest.php +++ b/tests/Events/RetrieveEventTest.php @@ -16,6 +16,7 @@ public function test() $retrievedEvent = $this->seatsioClient->events->retrieve($event->key); self::assertEquals($event->key, $retrievedEvent->key); + self::assertEquals(false, $retrievedEvent->isEventInSeason); self::assertEquals($event->id, $retrievedEvent->id); self::assertEquals($chartKey, $retrievedEvent->chartKey); self::assertEquals(TableBookingConfig::inherit(), $retrievedEvent->tableBookingConfig); @@ -35,6 +36,7 @@ public function testRetrieveSeason() $retrievedSeason = $this->seatsioClient->events->retrieve($season->key); self::assertEquals('aSeason', $retrievedSeason->key); + self::assertEquals(true, $retrievedSeason->isTopLevelSeason); self::assertEquals(['partialSeason1', 'partialSeason2'], $retrievedSeason->partialSeasonKeys); } diff --git a/tests/Seasons/CreateEventsInSeasonTest.php b/tests/Seasons/CreateEventsInSeasonTest.php index eb9f7dd..f1d5651 100644 --- a/tests/Seasons/CreateEventsInSeasonTest.php +++ b/tests/Seasons/CreateEventsInSeasonTest.php @@ -7,7 +7,7 @@ class CreateEventsInSeasonTest extends SeatsioClientTest { - public function eventKeys() + public function testEventKeys() { $chartKey = $this->createTestChart(); $season = $this->seatsioClient->seasons->create($chartKey); @@ -18,9 +18,11 @@ public function eventKeys() return $event->key; }); self::assertEquals(['event1', 'event2'], $eventKeys); + self::assertEquals(true, $updatedSeason->events[0]->isEventInSeason); + self::assertEquals($season->key, $updatedSeason->events[0]->topLevelSeasonKey); } - public function numberOfEvents() + public function testNumberOfEvents() { $chartKey = $this->createTestChart(); $season = $this->seatsioClient->seasons->create($chartKey); diff --git a/tests/Seasons/CreatePartialSeasonTest.php b/tests/Seasons/CreatePartialSeasonTest.php index e3e1f63..5a7d303 100644 --- a/tests/Seasons/CreatePartialSeasonTest.php +++ b/tests/Seasons/CreatePartialSeasonTest.php @@ -15,6 +15,8 @@ public function test() $partialSeason = $this->seatsioClient->seasons->createPartialSeason($season->key); self::assertNotNull($partialSeason->key); + self::assertEquals(true, $partialSeason->isPartialSeason); + self::assertEquals($season->key, $partialSeason->topLevelSeasonKey); } public function testPartialSeasonKeyCanBePassedIn() diff --git a/tests/Seasons/CreateSeasonTest.php b/tests/Seasons/CreateSeasonTest.php index 91481f4..13e7465 100644 --- a/tests/Seasons/CreateSeasonTest.php +++ b/tests/Seasons/CreateSeasonTest.php @@ -9,7 +9,6 @@ class CreateSeasonTest extends SeatsioClientTest { - public function testOnlyChartKeyIsRequired() { $chartKey = $this->createTestChart(); @@ -17,6 +16,8 @@ public function testOnlyChartKeyIsRequired() $season = $this->seatsioClient->seasons->create($chartKey); self::assertNotNull($season->key); + self::assertEquals(true, $season->isTopLevelSeason); + self::assertNull($season->topLevelSeasonKey); self::assertNotNull($season->id); self::assertEquals($chartKey, $season->chartKey); self::assertEquals(TableBookingConfig::inherit(), $season->tableBookingConfig);