oliverdavies.uk/modules/opd_presentations/tests/src/Functional/PresentationTest.php

28 lines
657 B
PHP

<?php
declare(strict_types=1);
namespace Drupal\opd_presentations\Functional;
use Drupal\Tests\opd_presentations\Traits\PresentationCreationTrait;
use Drupal\opd_presentations\Events;
use weitzman\DrupalTestTraits\ExistingSiteBase;
final class PresentationTest extends ExistingSiteBase {
use PresentationCreationTrait;
public function test_only_past_events_are_returned(): void {
$presentation = $this->createPresentation(
events: Events::fromDateStrings('now', 'yesterday', 'tomorrow'),
);
$events = $presentation->getEvents()->getPast();
$this->assertCount(
expectedCount: 1,
haystack: $events,
);
}
}