From 7975395d10bb381de8cd15b5ee15198318af6d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Viande?= Date: Wed, 11 Apr 2018 11:42:52 +0200 Subject: Entry: add archived_at property and updateArchived method --- tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 2 ++ tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | 2 +- tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/Wallabag') diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 58b617f3..6b26376d 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -438,6 +438,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertSame(0, $content['is_archived']); $this->assertSame(0, $content['is_starred']); $this->assertNull($content['starred_at']); + $this->assertNull($content['archived_at']); $this->assertSame('New title for my article', $content['title']); $this->assertSame(1, $content['user_id']); $this->assertCount(2, $content['tags']); @@ -533,6 +534,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertSame(1, $content['is_archived']); $this->assertSame(1, $content['is_starred']); $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); + $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['archived_at']))->getTimestamp()); $this->assertSame(1, $content['user_id']); } diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index e07c57dd..d709f4eb 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -849,7 +849,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $entryArchived->setContent('Youhou'); $entryArchived->setTitle('Youhou'); $entryArchived->addTag($tagArchived); - $entryArchived->setArchived(true); + $entryArchived->updateArchived(true); $em->persist($entryArchived); $annotationArchived = new Annotation($user); diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index bf0068b4..0ac119d8 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -621,7 +621,7 @@ class EntryControllerTest extends WallabagCoreTestCase $content->setMimetype('text/html'); $content->setTitle('test title entry'); $content->setContent('This is my content /o/'); - $content->setArchived(true); + $content->updateArchived(true); $content->setLanguage('fr'); $em->persist($content); @@ -774,7 +774,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); - $entry->setArchived(false); + $entry->updateArchived(false); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush(); @@ -1245,7 +1245,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl('http://0.0.0.0/foo/baz/qux'); $entry->setTitle('Le manège'); - $entry->setArchived(true); + $entry->updateArchived(true); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush(); @@ -1275,7 +1275,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl('http://domain/qux'); $entry->setTitle('Le manège'); - $entry->setArchived(true); + $entry->updateArchived(true); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush(); -- cgit v1.2.3