Use getTimestamp() method

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

View file

@ -15,9 +15,9 @@ final class PresentationTest extends ExistingSiteBase {
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->createEvent(['field_date' => (new DrupalDateTime('now'))->getTimestamp()]),
$this->createEvent(['field_date' => (new DrupalDateTime('yesterday'))->getTimestamp()]),
$this->createEvent(['field_date' => (new DrupalDateTime('tomorrow'))->getTimestamp()]),
],
);