aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-05-31 10:38:15 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-05-31 10:38:15 +0200
commitbad7df8c0048285e7a6bd539e5e501ce6675d663 (patch)
tree384b35ecebf7f1126e346edad79cb5ea0879ddbd /tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
parent7a8ed3cee1003aae56400e18509980e2695ea622 (diff)
downloadwallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.tar.gz
wallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.tar.zst
wallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.zip
CS & improve tags assertions
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
index 335115fe..18a02522 100644
--- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
+++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php
@@ -122,7 +122,10 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
122 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); 122 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok');
123 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); 123 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok');
124 $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); 124 $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok');
125 $this->assertEquals(1, count($content->getTags())); 125
126 $tags = $content->getTags();
127 $this->assertContains('foot', $tags, 'It includes the "foot" tag');
128 $this->assertEquals(1, count($tags));
126 129
127 $content = $client->getContainer() 130 $content = $client->getContainer()
128 ->get('doctrine.orm.entity_manager') 131 ->get('doctrine.orm.entity_manager')
@@ -135,7 +138,13 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
135 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); 138 $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'); 139 $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'); 140 $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok');
138 $this->assertEquals(3, count($content->getTags())); 141
142 $tags = $content->getTags();
143 $this->assertContains('foot', $tags, 'It includes the "foot" tag');
144 $this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag');
145 $this->assertContains('blog', $tags, 'It includes the "blog" tag');
146 $this->assertEquals(3, count($tags));
147
139 $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); 148 $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
140 $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); 149 $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
141 $this->assertTrue($content->isStarred(), 'Entry is starred'); 150 $this->assertTrue($content->isStarred(), 'Entry is starred');