aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-12-29 15:04:46 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-12-29 15:04:46 +0100
commit1bb1939ab76cfbf1cdb5fa1dccbdd15ba17cdfb0 (patch)
treeeaecbd4b0cc705d5de653d12d62805c9e551bc4c /src/Wallabag
parent01fddd0cb2fc6c83998a54d24d4ca6a27b564d36 (diff)
downloadwallabag-1bb1939ab76cfbf1cdb5fa1dccbdd15ba17cdfb0.tar.gz
wallabag-1bb1939ab76cfbf1cdb5fa1dccbdd15ba17cdfb0.tar.zst
wallabag-1bb1939ab76cfbf1cdb5fa1dccbdd15ba17cdfb0.zip
Cleanup tests
- 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)
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php4
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php3
2 files changed, 1 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index c5df1e03..459c4172 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -337,10 +337,6 @@ class WallabagRestController extends FOSRestController
337 ->getRepository('WallabagCoreBundle:Entry') 337 ->getRepository('WallabagCoreBundle:Entry')
338 ->removeTag($this->getUser()->getId(), $tag); 338 ->removeTag($this->getUser()->getId(), $tag);
339 339
340 $em = $this->getDoctrine()->getManager();
341 $em->remove($tag);
342 $em->flush();
343
344 $json = $this->get('serializer')->serialize($tag, 'json'); 340 $json = $this->get('serializer')->serialize($tag, 'json');
345 341
346 return $this->renderJsonResponse($json); 342 return $this->renderJsonResponse($json);
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
index cddc8b08..dee17d65 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
@@ -98,7 +98,6 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
98 $user = $this->getUser([$taggingRule]); 98 $user = $this->getUser([$taggingRule]);
99 $entry = new Entry($user); 99 $entry = new Entry($user);
100 $tag = new Tag(); 100 $tag = new Tag();
101 $tag->setLabel('foo');
102 101
103 $this->rulerz 102 $this->rulerz
104 ->expects($this->once()) 103 ->expects($this->once())
@@ -118,7 +117,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
118 $this->assertFalse($entry->getTags()->isEmpty()); 117 $this->assertFalse($entry->getTags()->isEmpty());
119 118
120 $tags = $entry->getTags(); 119 $tags = $entry->getTags();
121 $this->assertSame($tag->getLabel(), $tags[0]->getLabel()); 120 $this->assertSame($tag, $tags[0]);
122 } 121 }
123 122
124 public function testSameTagWithDifferentfMatchingRules() 123 public function testSameTagWithDifferentfMatchingRules()