protected function setUp($import_test_views = TRUE
): void
{ parent::
setUp($import_test_views);
// Change field storage to date-only.
$storage = FieldStorageConfig::
load('node.' .
static::
$fieldName);
$storage->
setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE
);
$storage->
save();
// Retrieve tomorrow, today and yesterday dates just to create the nodes.
$timestamp =
$this->
getUTCEquivalentOfUserNowAsTimestamp();
$dates =
$this->
getRelativeDateValuesFromTimestamp($timestamp);
// Clean the nodes on setUp.
$this->nodes =
[];
foreach ($dates as $date) { $node = Node::
create([ 'title' =>
$this->
randomMachineName(8
),
'type' => 'page',
'field_date' =>
[ 'value' =>
$date,
],
]);