aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
index 26e2f40b..24893259 100644
--- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
+++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
@@ -119,10 +119,14 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
119 $this->getLoggedInUserId() 119 $this->getLoggedInUserId()
120 ); 120 );
121 121
122 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); 122 // empty because it wasn't re-imported
123 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); 123 $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is empty');
124 $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); 124 $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is empty');
125 $this->assertEquals(0, count($content->getTags())); 125 $this->assertEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is empty');
126
127 $tags = $content->getTags();
128 $this->assertContains('foot', $tags, 'It includes the "foot" tag');
129 $this->assertEquals(1, count($tags));
126 130
127 $content = $client->getContainer() 131 $content = $client->getContainer()
128 ->get('doctrine.orm.entity_manager') 132 ->get('doctrine.orm.entity_manager')
@@ -135,9 +139,16 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
135 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); 139 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok');
136 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok'); 140 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok');
137 $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok'); 141 $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok');
138 $this->assertEquals(2, count($content->getTags())); 142
143 $tags = $content->getTags();
144 $this->assertContains('foot', $tags, 'It includes the "foot" tag');
145 $this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag');
146 $this->assertContains('blog', $tags, 'It includes the "blog" tag');
147 $this->assertEquals(3, count($tags));
148
139 $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); 149 $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
140 $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); 150 $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
151 $this->assertTrue($content->isStarred(), 'Entry is starred');
141 } 152 }
142 153
143 public function testImportWallabagWithEmptyFile() 154 public function testImportWallabagWithEmptyFile()