aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-10 18:40:15 +0100
committerThomas Citharel <tcit@tcit.fr>2016-02-10 18:40:15 +0100
commite686a76d343a3745c3dfe8010d9e5784e56bb17c (patch)
tree4c1258fd527d920ec40552e673d011f6e50ed619 /src/Wallabag/CoreBundle
parent567421af5019bf5937aa2b4214b405d87a1f1f86 (diff)
downloadwallabag-e686a76d343a3745c3dfe8010d9e5784e56bb17c.tar.gz
wallabag-e686a76d343a3745c3dfe8010d9e5784e56bb17c.tar.zst
wallabag-e686a76d343a3745c3dfe8010d9e5784e56bb17c.zip
improve test and change method name. Also, display number of entries for each tag
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php4
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());