From a3b64611f80f494ee8aae630c0d1528113a4fafa Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 21 Aug 2023 23:52:50 +0200 Subject: [PATCH] Fix testSaveIsStarredAfterPatch --- src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php | 5 +++++ .../ApiBundle/Controller/EntryRestControllerTest.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 064c874ba..97681a3d8 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -72,6 +72,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface 'content' => 'This is my content /o/', 'language' => 'fr', 'starred' => true, + 'starred_at' => new \DateTime(), 'preview' => 'http://0.0.0.0/image.jpg', ], 'entry6' => [ @@ -113,6 +114,10 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface $entry->setStarred($item['starred']); } + if (isset($item['starred_at'])) { + $entry->setStarredAt($item['starred_at']); + } + if (isset($item['archived'])) { $entry->setArchived($item['archived']); } diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index d88b99e64..34d2124ba 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -1065,7 +1065,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertSame(1, $content['is_starred']); - $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); + $this->assertGreaterThanOrEqual((new \DateTime($content['starred_at']))->getTimestamp(), $now->getTimestamp()); } public function dataForEntriesExistWithUrl()