]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Cleanup tests
authorJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 29 Dec 2015 14:04:46 +0000 (15:04 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 29 Dec 2015 14:04:46 +0000 (15:04 +0100)
- WallabagRestController: remove the tag deletion from the API since we can't remove a tag now, we only remove reference to entries
- RuleBasedTaggerTest: remove workaround for asserting tag are equal since problem was related to mock expects (_call instead of findOneByLabel which was removed from the tag repository)

src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php

index c5df1e03474c33b0e12ae27e4f787b610e5f1620..459c41729d8a8b9543a98c64cc6147267da3ce87 100644 (file)
@@ -337,10 +337,6 @@ class WallabagRestController extends FOSRestController
             ->getRepository('WallabagCoreBundle:Entry')
             ->removeTag($this->getUser()->getId(), $tag);
 
-        $em = $this->getDoctrine()->getManager();
-        $em->remove($tag);
-        $em->flush();
-
         $json = $this->get('serializer')->serialize($tag, 'json');
 
         return $this->renderJsonResponse($json);
index cddc8b086276a95f8cba4bb31cf444c345248f17..dee17d6575fe179b05b84d9fa41787bd227e91f1 100644 (file)
@@ -98,7 +98,6 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
         $user = $this->getUser([$taggingRule]);
         $entry = new Entry($user);
         $tag = new Tag();
-        $tag->setLabel('foo');
 
         $this->rulerz
             ->expects($this->once())
@@ -118,7 +117,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
         $this->assertFalse($entry->getTags()->isEmpty());
 
         $tags = $entry->getTags();
-        $this->assertSame($tag->getLabel(), $tags[0]->getLabel());
+        $this->assertSame($tag, $tags[0]);
     }
 
     public function testSameTagWithDifferentfMatchingRules()