X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FImportBundle%2FController%2FWallabagV1ControllerTest.php;h=2c492c207fc469acc7cf562ac4f3484764223c6d;hb=9fe87bc2e20fa95573287a61ef9798cc15648187;hp=acc3999797a7875a7268b83c52a26b756ad68d50;hpb=eef47c0ead8e7aa754f5160d077aaaa9f16937c9;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index acc39997..2c492c20 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php @@ -112,24 +112,22 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/', + 'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur', $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(1, count($content->getTags())); + $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty'); + $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is empty'); + $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is empty'); + + $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()); }