Ensure the correct event is returned
This commit is contained in:
parent
4715d02ae0
commit
08fc6c66be
3 changed files with 28 additions and 5 deletions
|
@ -14,15 +14,33 @@ final class PresentationTest extends ExistingSiteBase {
|
|||
public function test_only_past_events_are_returned(): void {
|
||||
$presentation = $this->createPresentation(
|
||||
events: [
|
||||
$this->createEvent(eventDate: 'now'),
|
||||
$this->createEvent(eventDate: 'yesterday'),
|
||||
$this->createEvent(eventDate: 'tomorrow'),
|
||||
$this->createEvent(
|
||||
eventDate: 'now',
|
||||
eventName: 'now',
|
||||
),
|
||||
|
||||
$this->createEvent(
|
||||
eventDate: 'yesterday',
|
||||
eventName: 'yesterday',
|
||||
),
|
||||
|
||||
$this->createEvent(
|
||||
eventDate: 'tomorrow',
|
||||
eventName: 'tomorrow',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
$events = $presentation->getPastEvents();
|
||||
|
||||
$this->assertCount(
|
||||
expectedCount: 1,
|
||||
haystack: $presentation->getPastEvents(),
|
||||
haystack: $events,
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
actual: $events->first()->get('field_event_name')->value,
|
||||
expected: 'yesterday',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue