aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-10-08 13:31:08 +0200
committerGitHub <noreply@github.com>2016-10-08 13:31:08 +0200
commite07c25a1adb2f89c5f57656e24a054ddd3a45df7 (patch)
treece4e9757d816c5ecd5e7f1c2420b5301b7c8a137 /tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
parentd9b0673dbb1138e805e039610cef893e49abe3d8 (diff)
parentac8cf632bb3a225c1b69d16e714ff60a2e988c89 (diff)
downloadwallabag-e07c25a1adb2f89c5f57656e24a054ddd3a45df7.tar.gz
wallabag-e07c25a1adb2f89c5f57656e24a054ddd3a45df7.tar.zst
wallabag-e07c25a1adb2f89c5f57656e24a054ddd3a45df7.zip
Merge pull request #2397 from wallabag/api-orphan-tags
Ensure orphan tag are remove in API
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
index 65b65290..c797daf7 100644
--- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
@@ -561,6 +561,8 @@ class WallabagRestControllerTest extends WallabagApiTestCase
561 */ 561 */
562 public function testDeleteUserTag($tag) 562 public function testDeleteUserTag($tag)
563 { 563 {
564 $tagName = $tag['label'];
565
564 $this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json'); 566 $this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json');
565 567
566 $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); 568 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@@ -577,6 +579,13 @@ class WallabagRestControllerTest extends WallabagApiTestCase
577 ->findAllByTagId($this->user->getId(), $tag['id']); 579 ->findAllByTagId($this->user->getId(), $tag['id']);
578 580
579 $this->assertCount(0, $entries); 581 $this->assertCount(0, $entries);
582
583 $tag = $this->client->getContainer()
584 ->get('doctrine.orm.entity_manager')
585 ->getRepository('WallabagCoreBundle:Tag')
586 ->findOneByLabel($tagName);
587
588 $this->assertNull($tag, $tagName.' was removed because it begun an orphan tag');
580 } 589 }
581 590
582 public function testDeleteTagByLabel() 591 public function testDeleteTagByLabel()