diff options
Diffstat (limited to 'src')
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 | |||
57 | * | 57 | * |
58 | * @return Tag | 58 | * @return Tag |
59 | */ | 59 | */ |
60 | public function findOnebyEntryAndLabel($entry, $label) | 60 | public function findOneByEntryAndTagLabel($entry, $label) |
61 | { | 61 | { |
62 | return $this->createQueryBuilder('t') | 62 | return $this->createQueryBuilder('t') |
63 | ->leftJoin('t.entries', 'e') | 63 | ->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 @@ | |||
9 | <br /> | 9 | <br /> |
10 | <ul class="row data"> | 10 | <ul class="row data"> |
11 | {% for tag in tags %} | 11 | {% for tag in tags %} |
12 | <li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}}</li> | 12 | <li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}} ({{ tag.entries.getValues | length }})</li> |
13 | {% endfor %} | 13 | {% endfor %} |
14 | </ul> | 14 | </ul> |
15 | {% endblock %} | 15 | {% 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 | |||
81 | $tag = $client->getContainer() | 81 | $tag = $client->getContainer() |
82 | ->get('doctrine.orm.entity_manager') | 82 | ->get('doctrine.orm.entity_manager') |
83 | ->getRepository('WallabagCoreBundle:Tag') | 83 | ->getRepository('WallabagCoreBundle:Tag') |
84 | ->findOnebyEntryAndLabel($entry, $this->tagName); | 84 | ->findOneByEntryAndTagLabel($entry, $this->tagName); |
85 | 85 | ||
86 | $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); | 86 | $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); |
87 | 87 | ||
88 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 88 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
89 | 89 | ||
90 | $this->assertNotContains($this->tagName, $entry->getTags()); | ||
91 | |||
90 | $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); | 92 | $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); |
91 | 93 | ||
92 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); | 94 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); |