Move test
This commit is contained in:
parent
3eda366625
commit
7ad811d2cb
1 changed files with 1 additions and 1 deletions
|
@ -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(),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue