diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-31 10:38:00 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-31 10:38:00 +0200 |
commit | 7a8ed3cee1003aae56400e18509980e2695ea622 (patch) | |
tree | 6719b99d1a5a370ac6c9d41c965a04f689383d39 /tests/Wallabag/ImportBundle/Controller | |
parent | 7aa5607f297d5ef188d06cc3f808f9ff5bda83b2 (diff) | |
download | wallabag-7a8ed3cee1003aae56400e18509980e2695ea622.tar.gz wallabag-7a8ed3cee1003aae56400e18509980e2695ea622.tar.zst wallabag-7a8ed3cee1003aae56400e18509980e2695ea622.zip |
Add support for tag in Instapaper import
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller')
-rw-r--r-- | tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index c2e5fdb7..84742e0a 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php | |||
@@ -107,6 +107,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
110 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | ||
111 | $this->assertContains('flashes.import.notice.summary', $body[0]); | ||
112 | |||
110 | $content = $client->getContainer() | 113 | $content = $client->getContainer() |
111 | ->get('doctrine.orm.entity_manager') | 114 | ->get('doctrine.orm.entity_manager') |
112 | ->getRepository('WallabagCoreBundle:Entry') | 115 | ->getRepository('WallabagCoreBundle:Entry') |
@@ -115,14 +118,25 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
115 | $this->getLoggedInUserId() | 118 | $this->getLoggedInUserId() |
116 | ); | 119 | ); |
117 | 120 | ||
118 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | ||
119 | $this->assertContains('flashes.import.notice.summary', $body[0]); | ||
120 | |||
121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); | 121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); |
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); | 122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); | 123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); |
124 | $this->assertContains('foot', $content->getTags(), 'It includes the "foot" tag'); | ||
124 | $this->assertEquals(1, count($content->getTags())); | 125 | $this->assertEquals(1, count($content->getTags())); |
125 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 126 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
127 | |||
128 | $content = $client->getContainer() | ||
129 | ->get('doctrine.orm.entity_manager') | ||
130 | ->getRepository('WallabagCoreBundle:Entry') | ||
131 | ->findByUrlAndUserId( | ||
132 | 'http://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe', | ||
133 | $this->getLoggedInUserId() | ||
134 | ); | ||
135 | |||
136 | $this->assertContains('foot', $content->getTags()); | ||
137 | $this->assertContains('test_tag', $content->getTags()); | ||
138 | |||
139 | $this->assertEquals(2, count($content->getTags())); | ||
126 | } | 140 | } |
127 | 141 | ||
128 | public function testImportInstapaperWithFileAndMarkAllAsRead() | 142 | public function testImportInstapaperWithFileAndMarkAllAsRead() |