CS & improve tags assertions

This commit is contained in:
Jeremy Benoist
2017-05-31 10:38:15 +02:00
parent 7a8ed3cee1
commit bad7df8c00
9 changed files with 34 additions and 18 deletions

View File

@ -116,20 +116,18 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->getLoggedInUserId()
);
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->findOneByLabel('Framabag');
$this->assertTrue($content->getTags()->contains($tag));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok');
$this->assertEquals(2, count($content->getTags()));
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag');
$this->assertEquals(2, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}