aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-10 17:41:28 +0100
committerThomas Citharel <tcit@tcit.fr>2016-02-10 17:41:28 +0100
commit567421af5019bf5937aa2b4214b405d87a1f1f86 (patch)
treed1f8d3ad8593a3a6f33662217a81cbd731287fc9 /src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php
parentae5b37ef2e52c06182bc6edb14f6b3aae381ddb4 (diff)
downloadwallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.tar.gz
wallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.tar.zst
wallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.zip
remove tag from entry #1377
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php
index dc93dd6b..ae29a2a6 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php
@@ -6,6 +6,8 @@ use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
6 6
7class TagControllerTest extends WallabagCoreTestCase 7class TagControllerTest extends WallabagCoreTestCase
8{ 8{
9 public $tagName = 'opensource';
10
9 public function testList() 11 public function testList()
10 { 12 {
11 $this->logInAs('admin'); 13 $this->logInAs('admin');
@@ -31,7 +33,7 @@ class TagControllerTest extends WallabagCoreTestCase
31 $form = $crawler->filter('button[id=tag_save]')->form(); 33 $form = $crawler->filter('button[id=tag_save]')->form();
32 34
33 $data = array( 35 $data = array(
34 'tag[label]' => 'opensource', 36 'tag[label]' => $this->tagName,
35 ); 37 );
36 38
37 $client->submit($form, $data); 39 $client->submit($form, $data);
@@ -65,4 +67,28 @@ class TagControllerTest extends WallabagCoreTestCase
65 67
66 $this->assertEquals(2, count($newEntry->getTags())); 68 $this->assertEquals(2, count($newEntry->getTags()));
67 } 69 }
70
71 public function testRemoveTagFromEntry()
72 {
73 $this->logInAs('admin');
74 $client = $this->getClient();
75
76 $entry = $client->getContainer()
77 ->get('doctrine.orm.entity_manager')
78 ->getRepository('WallabagCoreBundle:Entry')
79 ->findOneByUsernameAndNotArchived('admin');
80
81 $tag = $client->getContainer()
82 ->get('doctrine.orm.entity_manager')
83 ->getRepository('WallabagCoreBundle:Tag')
84 ->findOnebyEntryAndLabel($entry, $this->tagName);
85
86 $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());
87
88 $this->assertEquals(302, $client->getResponse()->getStatusCode());
89
90 $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());
91
92 $this->assertEquals(404, $client->getResponse()->getStatusCode());
93 }
68} 94}