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

Commit

Permalink
Merge pull request #2440 from ec-europa/off-by-1-second
Browse files Browse the repository at this point in the history
RFT: publication date is 1 second later than creation date
  • Loading branch information
pfrenssen authored Mar 31, 2021
2 parents 05a00d5 + df67459 commit 4949d21
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 4949d21

Please sign in to comment.