X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;fp=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;h=22a0d27eb98973d463e53d10e3c880a6e2048633;hb=e0a862b626553ce3ae9c7e87178e5598275f4775;hp=0e7e157600c793db2f5a7558e0014351a199f4e8;hpb=8e15ece7df98709202d03ad6a52158249e37ec70;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 0e7e1576..22a0d27e 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Controller; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\SiteCredential; use Wallabag\CoreBundle\Helper\ContentProxy; @@ -1478,4 +1479,23 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame('email_tracking.pdf', $content->getTitle()); $this->assertSame('example.com', $content->getDomainName()); } + + public function testEntryDeleteTagLink() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $entry = $em->getRepository('WallabagCoreBundle:Entry')->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId()); + $tag = $entry->getTags()[0]; + + $crawler = $client->request('GET', '/view/' . $entry->getId()); + + // As long as the deletion link of a tag is following + // a link to the tag view, we take the second one to retrieve + // the deletion link of the first tag + $link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract('href')[1]; + + $this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link); + } }