diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-31 10:38:15 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-31 10:38:15 +0200 |
commit | bad7df8c0048285e7a6bd539e5e501ce6675d663 (patch) | |
tree | 384b35ecebf7f1126e346edad79cb5ea0879ddbd /tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |
parent | 7a8ed3cee1003aae56400e18509980e2695ea622 (diff) | |
download | wallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.tar.gz wallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.tar.zst wallabag-bad7df8c0048285e7a6bd539e5e501ce6675d663.zip |
CS & improve tags assertions
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 0c7f97ed..4ca6e623 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -116,20 +116,18 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
116 | $this->getLoggedInUserId() | 116 | $this->getLoggedInUserId() |
117 | ); | 117 | ); |
118 | 118 | ||
119 | $tag = $client->getContainer() | ||
120 | ->get('doctrine.orm.entity_manager') | ||
121 | ->getRepository('WallabagCoreBundle:Tag') | ||
122 | ->findOneByLabel('Framabag'); | ||
123 | |||
124 | $this->assertTrue($content->getTags()->contains($tag)); | ||
125 | |||
126 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 119 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
127 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 120 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
128 | 121 | ||
129 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok'); | 122 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok'); |
130 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok'); | 123 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok'); |
131 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok'); | 124 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok'); |
132 | $this->assertEquals(2, count($content->getTags())); | 125 | |
126 | $tags = $content->getTags(); | ||
127 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | ||
128 | $this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag'); | ||
129 | $this->assertEquals(2, count($tags)); | ||
130 | |||
133 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 131 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
134 | } | 132 | } |
135 | 133 | ||