aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-31 12:32:09 +0200
committerGitHub <noreply@github.com>2017-05-31 12:32:09 +0200
commit4423b88c5b2c2d530b0a83a822f521a61ca4d4b8 (patch)
tree26f8cf2ead0107ac74a7cd9eeb522f222eecbd53 /tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php
parentd61fd8be4ffdbba8d0fd02468075602a26dfde1a (diff)
parentbad7df8c0048285e7a6bd539e5e501ce6675d663 (diff)
downloadwallabag-4423b88c5b2c2d530b0a83a822f521a61ca4d4b8.tar.gz
wallabag-4423b88c5b2c2d530b0a83a822f521a61ca4d4b8.tar.zst
wallabag-4423b88c5b2c2d530b0a83a822f521a61ca4d4b8.zip
Merge pull request #3168 from wallabag/instapaper-tags-import
Add support for tag in Instapaper import
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php20
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()