core/modules/tracker/src/Tests/TrackerTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php index 72d691c..b09a8f6 100644 --- a/core/modules/tracker/src/Tests/TrackerTest.php +++ b/core/modules/tracker/src/Tests/TrackerTest.php @@ -185,7 +185,7 @@ function testTrackerHistoryMetadata() { ); $node = $this->drupalCreateNode($edit); - // Verify. + // Verify that the history metadata is present. $this->drupalGet('activity'); $this->assertHistoryMetadata($node->id(), $node->getChangedTime(), $node->getChangedTime()); $this->drupalGet('activity/' . $this->user->id()); @@ -193,7 +193,9 @@ function testTrackerHistoryMetadata() { $this->drupalGet('user/' . $this->user->id() . '/activity'); $this->assertHistoryMetadata($node->id(), $node->getChangedTime(), $node->getChangedTime()); - // Add a comment to the page, make sure it is created after the node. + // Add a comment to the page, make sure it is created after the node by + // sleeping for one second, to ensure the last comment timestamp is + // different from before. $comment = array( 'subject[0][value]' => $this->randomMachineName(), 'comment_body[0][value]' => $this->randomMachineName(20), @@ -205,7 +207,7 @@ function testTrackerHistoryMetadata() { // posted comment. $node = Node::load($node->id()); - // Verify. + // Verify that the history metadata is updated. $this->drupalGet('activity'); $this->assertHistoryMetadata($node->id(), $node->getChangedTime(), $node->get('comment')->last_comment_timestamp); $this->drupalGet('activity/' . $this->user->id());