Skip to content

Commit

Permalink
Fix failing randomly test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosomb committed Jul 27, 2023
1 parent 90631ab commit 5fe5551
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
Expand Up @@ -237,14 +237,18 @@ public function testTags()
$entry1->setCreatedAt($day1);
$entry4->setCreatedAt($day2);

$property = (new \ReflectionObject($entry1))->getProperty('updatedAt');
$property->setAccessible(true);
$property->setValue($entry1, $day4);

$property = (new \ReflectionObject($entry4))->getProperty('updatedAt');
$property->setAccessible(true);
$property->setValue($entry4, $day3);

// We have to flush and sleep here to be sure that $entry1 and $entry4 have different updatedAt values
$em->flush();
sleep(2);

$property = (new \ReflectionObject($entry1))->getProperty('updatedAt');
$property->setAccessible(true);
$property->setValue($entry1, $day4);

$em->flush();

$client = $this->getTestClient();
Expand Down

0 comments on commit 5fe5551

Please sign in to comment.