aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2017-12-31 00:56:40 +0100
committerKevin Decherf <kevin@kdecherf.com>2017-12-31 00:56:40 +0100
commite0a862b626553ce3ae9c7e87178e5598275f4775 (patch)
tree581ca47396bf96e98b2d9769631448913d4f8346 /tests
parent8e15ece7df98709202d03ad6a52158249e37ec70 (diff)
downloadwallabag-e0a862b626553ce3ae9c7e87178e5598275f4775.tar.gz
wallabag-e0a862b626553ce3ae9c7e87178e5598275f4775.tar.zst
wallabag-e0a862b626553ce3ae9c7e87178e5598275f4775.zip
Add test to prevent regression for #3534
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php20
1 files changed, 20 insertions, 0 deletions
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;
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; 5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Wallabag\CoreBundle\Entity\Config; 6use Wallabag\CoreBundle\Entity\Config;
7use Wallabag\CoreBundle\Entity\Entry; 7use Wallabag\CoreBundle\Entity\Entry;
8use Wallabag\CoreBundle\Entity\Tag;
8use Wallabag\CoreBundle\Entity\SiteCredential; 9use Wallabag\CoreBundle\Entity\SiteCredential;
9use Wallabag\CoreBundle\Helper\ContentProxy; 10use Wallabag\CoreBundle\Helper\ContentProxy;
10 11
@@ -1478,4 +1479,23 @@ class EntryControllerTest extends WallabagCoreTestCase
1478 $this->assertSame('email_tracking.pdf', $content->getTitle()); 1479 $this->assertSame('email_tracking.pdf', $content->getTitle());
1479 $this->assertSame('example.com', $content->getDomainName()); 1480 $this->assertSame('example.com', $content->getDomainName());
1480 } 1481 }
1482
1483 public function testEntryDeleteTagLink()
1484 {
1485 $this->logInAs('admin');
1486 $client = $this->getClient();
1487
1488 $em = $client->getContainer()->get('doctrine.orm.entity_manager');
1489 $entry = $em->getRepository('WallabagCoreBundle:Entry')->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
1490 $tag = $entry->getTags()[0];
1491
1492 $crawler = $client->request('GET', '/view/' . $entry->getId());
1493
1494 // As long as the deletion link of a tag is following
1495 // a link to the tag view, we take the second one to retrieve
1496 // the deletion link of the first tag
1497 $link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract('href')[1];
1498
1499 $this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
1500 }
1481} 1501}