Skip to content

Commit

Permalink
Exposed partialSeasonKeysForEvent (#103)
Browse files Browse the repository at this point in the history
* Exposed partialSeasonKeysForEvent

* Fixed test
  • Loading branch information
mroloux authored Nov 9, 2023
1 parent e463999 commit 63d2cf9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ class Event
*/
public $isInThePast;

/**
* @var string[]
*/
public $partialSeasonKeysForEvent;

public function isSeason()
{
return false;
Expand Down
2 changes: 2 additions & 0 deletions tests/Events/RetrieveEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function test()
self::assertEquals(9, $retrievedEvent->categories[0]->key);
self::assertEquals(10, $retrievedEvent->categories[1]->key);
self::assertEquals("string11", $retrievedEvent->categories[2]->key);
self::assertNull($retrievedEvent->partialSeasonKeysForEvent);
}

public function testRetrieveSeason()
Expand All @@ -43,6 +44,7 @@ public function testRetrieveSeason()
self::assertEquals('aSeason', $retrievedSeason->key);
self::assertEquals(true, $retrievedSeason->isTopLevelSeason);
self::assertEquals(['partialSeason1', 'partialSeason2'], $retrievedSeason->partialSeasonKeys);
self::assertNull($retrievedSeason->partialSeasonKeysForEvent);
}

}
1 change: 1 addition & 0 deletions tests/Seasons/AddEventsToPartialSeasonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ public function test()
return $event->key;
});
self::assertEquals(['event1', 'event2'], $eventKeys);
self::assertEquals([$updatedPartialSeason->key], $updatedPartialSeason->events[0]->partialSeasonKeysForEvent);
}
}
1 change: 1 addition & 0 deletions tests/Seasons/CreatePartialSeasonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ public function testEventKeysCanBePassedIn()
return $event->key;
});
self::assertEquals(['event1', 'event2'], $eventKeys);
self::assertEquals([$partialSeason->key], $partialSeason->events[0]->partialSeasonKeysForEvent);
}
}

0 comments on commit 63d2cf9

Please sign in to comment.