diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-09 09:36:07 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 21:58:55 +0200 |
commit | 6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926 (patch) | |
tree | 38ea829aeea879f4bfdd9873cea556a244247b7e /tests | |
parent | 3aca0a9f00417b64203a660dee0a2b4c0fe22ac8 (diff) | |
download | wallabag-6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926.tar.gz wallabag-6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926.tar.zst wallabag-6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926.zip |
Add ability to define created_at for all import
At the moment only Readability & wallabag v2 import allow created_at import.
Pocket removed `time_added` field from their API v2 to v3...
And wallabag v1 doesn't export that value.
Diffstat (limited to 'tests')
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index 92cf4bfc..fb39356a 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php | |||
@@ -49,6 +49,13 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 50 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
51 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 51 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
52 | |||
53 | $this->assertNotEmpty($content->getMimetype()); | ||
54 | $this->assertNotEmpty($content->getPreviewPicture()); | ||
55 | $this->assertNotEmpty($content->getLanguage()); | ||
56 | $this->assertEquals(0, count($content->getTags())); | ||
57 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | ||
58 | $this->assertEquals('2016-08-25', $content->getCreatedAt()->format('Y-m-d')); | ||
52 | } | 59 | } |
53 | 60 | ||
54 | public function testImportReadabilityWithFileAndMarkAllAsRead() | 61 | public function testImportReadabilityWithFileAndMarkAllAsRead() |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index c1025b41..ff1bf6f0 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -56,6 +56,12 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
56 | 56 | ||
57 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 57 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
58 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 58 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
59 | |||
60 | $this->assertEmpty($content->getMimetype()); | ||
61 | $this->assertEmpty($content->getPreviewPicture()); | ||
62 | $this->assertEmpty($content->getLanguage()); | ||
63 | $this->assertEquals(1, count($content->getTags())); | ||
64 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | ||
59 | } | 65 | } |
60 | 66 | ||
61 | public function testImportWallabagWithFileAndMarkAllAsRead() | 67 | public function testImportWallabagWithFileAndMarkAllAsRead() |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index d8d2c8bf..149e88bb 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php | |||
@@ -67,6 +67,8 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
67 | $this->assertNotEmpty($content->getPreviewPicture()); | 67 | $this->assertNotEmpty($content->getPreviewPicture()); |
68 | $this->assertNotEmpty($content->getLanguage()); | 68 | $this->assertNotEmpty($content->getLanguage()); |
69 | $this->assertEquals(2, count($content->getTags())); | 69 | $this->assertEquals(2, count($content->getTags())); |
70 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | ||
71 | $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); | ||
70 | } | 72 | } |
71 | 73 | ||
72 | public function testImportWallabagWithEmptyFile() | 74 | public function testImportWallabagWithEmptyFile() |