X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FApiBundle%2FController%2FWallabagRestControllerTest.php;h=c797daf7aa3a9444e87df384fe87a4eb9f4c3789;hb=ac8cf632bb3a225c1b69d16e714ff60a2e988c89;hp=65b65290c2e83731c0e535b11f9ff673fa35406b;hpb=3049afe190d125e4861059b6bbad7c6fbea6f1bb;p=github%2Fwallabag%2Fwallabag.git 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 */ public function testDeleteUserTag($tag) { + $tagName = $tag['label']; + $this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json'); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); @@ -577,6 +579,13 @@ class WallabagRestControllerTest extends WallabagApiTestCase ->findAllByTagId($this->user->getId(), $tag['id']); $this->assertCount(0, $entries); + + $tag = $this->client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Tag') + ->findOneByLabel($tagName); + + $this->assertNull($tag, $tagName.' was removed because it begun an orphan tag'); } public function testDeleteTagByLabel()