X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;h=95482fe4b580b8ab2881b35eecebbf1e71644638;hb=739a4024fa64ba5412078e01c8ae84628f865f26;hp=0e7e157600c793db2f5a7558e0014351a199f4e8;hpb=ef5c8a7d01d7b3f0041455503499ab67e2206e0d;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 0e7e1576..95482fe4 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 @@ -475,7 +476,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame(200, $client->getResponse()->getStatusCode()); - $form = $crawler->filter('button[type=submit]')->form(); + $form = $crawler->filter('button[id=entry_save]')->form(); $data = [ 'entry[title]' => 'My updated title hehe :)', @@ -508,7 +509,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame(200, $client->getResponse()->getStatusCode()); - $form = $crawler->filter('button[type=submit]')->form(); + $form = $crawler->filter('button[id=entry_save]')->form(); $data = [ 'entry[title]' => 'My updated title hehe :)', @@ -1308,12 +1309,12 @@ class EntryControllerTest extends WallabagCoreTestCase 'https://www.pravda.ru/world/09-06-2017/1337283-qatar-0/', 'ru', ], - 'fr-FR' => [ - 'https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', - 'fr_FR', + 'fr' => [ + 'https://fr.wikipedia.org/wiki/Wallabag', + 'fr', ], 'de' => [ - 'http://www.bild.de/politik/ausland/theresa-may/wahlbeben-grossbritannien-analyse-52108924.bild.html', + 'https://www.bild.de/politik/ausland/theresa-may/wahlbeben-grossbritannien-analyse-52108924.bild.html', 'de', ], 'it' => [ @@ -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); + } }