mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-07 03:04:08 +01:00
improve test and change method name. Also, display number of entries for each tag
This commit is contained in:
parent
567421af50
commit
e686a76d34
@ -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')
|
||||
|
@ -9,7 +9,7 @@
|
||||
<br />
|
||||
<ul class="row data">
|
||||
{% for tag in tags %}
|
||||
<li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}}</li>
|
||||
<li id="tag-{{ tag.id|e }}" class="col l4 m6 s12">{{tag.label}} ({{ tag.entries.getValues | length }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user