diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2018-09-21 09:46:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-21 09:46:58 +0000 |
commit | 2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08 (patch) | |
tree | a145b39f411f1981444fa68ad26f8789abdfa35a /tests | |
parent | 2f3af70e1ae6f9dd403e87d232ddf5315e34e430 (diff) | |
parent | 9007fe006286c63a7793326d9429792383ebd76d (diff) | |
download | wallabag-2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08.tar.gz wallabag-2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08.tar.zst wallabag-2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08.zip |
Merge pull request #3630 from sviande/archived_at
Entry: add archived_at property and updateArchived method
Diffstat (limited to 'tests')
3 files changed, 7 insertions, 5 deletions
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 | |||
438 | $this->assertSame(0, $content['is_archived']); | 438 | $this->assertSame(0, $content['is_archived']); |
439 | $this->assertSame(0, $content['is_starred']); | 439 | $this->assertSame(0, $content['is_starred']); |
440 | $this->assertNull($content['starred_at']); | 440 | $this->assertNull($content['starred_at']); |
441 | $this->assertNull($content['archived_at']); | ||
441 | $this->assertSame('New title for my article', $content['title']); | 442 | $this->assertSame('New title for my article', $content['title']); |
442 | $this->assertSame(1, $content['user_id']); | 443 | $this->assertSame(1, $content['user_id']); |
443 | $this->assertCount(2, $content['tags']); | 444 | $this->assertCount(2, $content['tags']); |
@@ -533,6 +534,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
533 | $this->assertSame(1, $content['is_archived']); | 534 | $this->assertSame(1, $content['is_archived']); |
534 | $this->assertSame(1, $content['is_starred']); | 535 | $this->assertSame(1, $content['is_starred']); |
535 | $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); | 536 | $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); |
537 | $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['archived_at']))->getTimestamp()); | ||
536 | $this->assertSame(1, $content['user_id']); | 538 | $this->assertSame(1, $content['user_id']); |
537 | } | 539 | } |
538 | 540 | ||
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 | |||
849 | $entryArchived->setContent('Youhou'); | 849 | $entryArchived->setContent('Youhou'); |
850 | $entryArchived->setTitle('Youhou'); | 850 | $entryArchived->setTitle('Youhou'); |
851 | $entryArchived->addTag($tagArchived); | 851 | $entryArchived->addTag($tagArchived); |
852 | $entryArchived->setArchived(true); | 852 | $entryArchived->updateArchived(true); |
853 | $em->persist($entryArchived); | 853 | $em->persist($entryArchived); |
854 | 854 | ||
855 | $annotationArchived = new Annotation($user); | 855 | $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 | |||
621 | $content->setMimetype('text/html'); | 621 | $content->setMimetype('text/html'); |
622 | $content->setTitle('test title entry'); | 622 | $content->setTitle('test title entry'); |
623 | $content->setContent('This is my content /o/'); | 623 | $content->setContent('This is my content /o/'); |
624 | $content->setArchived(true); | 624 | $content->updateArchived(true); |
625 | $content->setLanguage('fr'); | 625 | $content->setLanguage('fr'); |
626 | 626 | ||
627 | $em->persist($content); | 627 | $em->persist($content); |
@@ -774,7 +774,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
774 | 774 | ||
775 | $entry = new Entry($this->getLoggedInUser()); | 775 | $entry = new Entry($this->getLoggedInUser()); |
776 | $entry->setUrl($this->url); | 776 | $entry->setUrl($this->url); |
777 | $entry->setArchived(false); | 777 | $entry->updateArchived(false); |
778 | $this->getEntityManager()->persist($entry); | 778 | $this->getEntityManager()->persist($entry); |
779 | $this->getEntityManager()->flush(); | 779 | $this->getEntityManager()->flush(); |
780 | 780 | ||
@@ -1245,7 +1245,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1245 | $entry = new Entry($this->getLoggedInUser()); | 1245 | $entry = new Entry($this->getLoggedInUser()); |
1246 | $entry->setUrl('http://0.0.0.0/foo/baz/qux'); | 1246 | $entry->setUrl('http://0.0.0.0/foo/baz/qux'); |
1247 | $entry->setTitle('Le manège'); | 1247 | $entry->setTitle('Le manège'); |
1248 | $entry->setArchived(true); | 1248 | $entry->updateArchived(true); |
1249 | $this->getEntityManager()->persist($entry); | 1249 | $this->getEntityManager()->persist($entry); |
1250 | $this->getEntityManager()->flush(); | 1250 | $this->getEntityManager()->flush(); |
1251 | 1251 | ||
@@ -1275,7 +1275,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1275 | $entry = new Entry($this->getLoggedInUser()); | 1275 | $entry = new Entry($this->getLoggedInUser()); |
1276 | $entry->setUrl('http://domain/qux'); | 1276 | $entry->setUrl('http://domain/qux'); |
1277 | $entry->setTitle('Le manège'); | 1277 | $entry->setTitle('Le manège'); |
1278 | $entry->setArchived(true); | 1278 | $entry->updateArchived(true); |
1279 | $this->getEntityManager()->persist($entry); | 1279 | $this->getEntityManager()->persist($entry); |
1280 | $this->getEntityManager()->flush(); | 1280 | $this->getEntityManager()->flush(); |
1281 | 1281 | ||