Move test

This commit is contained in:
Oliver Davies 2025-06-11 09:09:38 +01:00
parent 3eda366625
commit 7ad811d2cb

View file

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Drupal\opd_presentations\Functional\Entity;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Tests\opd_presentations\Traits\PresentationCreationTrait;
use weitzman\DrupalTestTraits\ExistingSiteBase;
final class PresentationTest extends ExistingSiteBase {
use PresentationCreationTrait;
public function test_only_past_events_are_returned(): void {
$presentation = $this->createPresentation(
events: [
$this->createEvent(['field_date' => (new DrupalDateTime('now'))->format('U')]),
$this->createEvent(['field_date' => (new DrupalDateTime('yesterday'))->format('U')]),
$this->createEvent(['field_date' => (new DrupalDateTime('tomorrow'))->format('U')]),
],
);
$this->assertCount(
expectedCount: 1,
haystack: $presentation->getPastEvents(),
);
}
}