X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;fp=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;h=e424f152c40630616509c219c690ef8e9cdf0bd7;hb=410216f435bd9594f37e861d0a0fea8205956a67;hp=0e7e157600c793db2f5a7558e0014351a199f4e8;hpb=2679eb9d844379b65cd126975ef2d3625d39081f;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 0e7e1576..e424f152 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -6,6 +6,7 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\SiteCredential; +use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Helper\ContentProxy; class EntryControllerTest extends WallabagCoreTestCase @@ -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); + } }