From e686a76d343a3745c3dfe8010d9e5784e56bb17c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 10 Feb 2016 18:40:15 +0100 Subject: improve test and change method name. Also, display number of entries for each tag --- src/Wallabag/CoreBundle/Repository/TagRepository.php | 2 +- .../CoreBundle/Resources/views/themes/material/Tag/tags.html.twig | 2 +- src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 8d9cf85c..afeb985b 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -57,7 +57,7 @@ class TagRepository extends EntityRepository * * @return Tag */ - public function findOnebyEntryAndLabel($entry, $label) + public function findOneByEntryAndTagLabel($entry, $label) { return $this->createQueryBuilder('t') ->leftJoin('t.entries', 'e') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 9f92c178..19754d41 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -9,7 +9,7 @@
{% endblock %} diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php index ae29a2a6..d6391282 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php @@ -81,12 +81,14 @@ class TagControllerTest extends WallabagCoreTestCase $tag = $client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Tag') - ->findOnebyEntryAndLabel($entry, $this->tagName); + ->findOneByEntryAndTagLabel($entry, $this->tagName); $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertNotContains($this->tagName, $entry->getTags()); + $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); $this->assertEquals(404, $client->getResponse()->getStatusCode()); -- cgit v1.2.3