Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

RFT: publication date is 1 second later than creation date #2440

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/src/Context/JoinupCommunityContentContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ public function assertSamePublishedCreatedTime(string $title, string $type): voi
throw new \InvalidArgumentException('Node does not have a publication date field.');
}
Assert::assertNotEmpty($node->getPublicationTime());
Assert::assertEquals($node->created->value, $node->getPublicationTime());

// Depending on the performance of the test environment it is possible that
// a small amount of time has passed between the moment the node was created
// and the moment it was published. We allow a grace period of 5 seconds to
// account for the difference between the created and the publication date.
Assert::assertTrue(abs((int) $node->created->value - (int) $node->getPublicationTime()) < 5);
}

/**
Expand Down