]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
Merge pull request #2393 from wallabag/api-urls-exist
[github/wallabag/wallabag.git] / tests / Wallabag / ApiBundle / Controller / WallabagRestControllerTest.php
index 4f16e70f9ae2334d06be47dc3fd830eac202c9ed..5dcb3e000dac75d68f0026851856dcdc0692973b 100644 (file)
@@ -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()