aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
diff options
context:
space:
mode:
authorPaulino Michelazzo <paulino@michelazzo.com.br>2016-10-18 22:48:23 +0200
committerPaulino Michelazzo <paulino@michelazzo.com.br>2016-10-18 22:48:23 +0200
commit99731f0bb1f6fd2815eeb9af504ce86df927657b (patch)
treeb080efc608d2bbd52b77a4a0067402007f50c5a8 /tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
parent3a3c6b866b52721431bed22426d9abfcd0d2dfe0 (diff)
parent7180aaed45dce62e40620a9e4b202526ebd6a3bb (diff)
downloadwallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.gz
wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.zst
wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.zip
Merge remote-tracking branch 'wallabag/master'
Diffstat (limited to 'tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 7abb0737..5d772602 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -296,6 +296,29 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
296 $this->assertEquals('tag2', $entry->getTags()[1]->getLabel()); 296 $this->assertEquals('tag2', $entry->getTags()[1]->getLabel());
297 } 297 }
298 298
299 public function testAssignTagsNotFlushed()
300 {
301 $graby = $this->getMockBuilder('Graby\Graby')
302 ->disableOriginalConstructor()
303 ->getMock();
304
305 $tagRepo = $this->getTagRepositoryMock();
306 $tagRepo->expects($this->never())
307 ->method('__call');
308
309 $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger());
310
311 $tagEntity = new Tag();
312 $tagEntity->setLabel('tag1');
313
314 $entry = new Entry(new User());
315
316 $proxy->assignTagsToEntry($entry, 'tag1', [$tagEntity]);
317
318 $this->assertCount(1, $entry->getTags());
319 $this->assertEquals('tag1', $entry->getTags()[0]->getLabel());
320 }
321
299 private function getTaggerMock() 322 private function getTaggerMock()
300 { 323 {
301 return $this->getMockBuilder('Wallabag\CoreBundle\Helper\RuleBasedTagger') 324 return $this->getMockBuilder('Wallabag\CoreBundle\Helper\RuleBasedTagger')