From 625acf335298186b4ff983f9321900d1238e854b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Sat, 24 Oct 2015 15:11:06 +0200 Subject: Add a command to automatically tag all entries for a user --- .../CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle/Tests') diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php index 56a1ed61..5180f7dd 100644 --- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php @@ -12,15 +12,17 @@ use Wallabag\CoreBundle\Helper\RuleBasedTagger; class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase { private $rulerz; - private $repository; + private $tagRepository; + private $entryRepository; private $tagger; public function setUp() { - $this->rulerz = $this->getRulerZMock(); - $this->repository = $this->getTagRepositoryMock(); + $this->rulerz = $this->getRulerZMock(); + $this->tagRepository = $this->getTagRepositoryMock(); + $this->entryRepository = $this->getEntryRepositoryMock(); - $this->tagger = new RuleBasedTagger($this->rulerz, $this->repository); + $this->tagger = new RuleBasedTagger($this->rulerz, $this->tagRepository, $this->entryRepository); } public function testTagWithNoRule() @@ -106,7 +108,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase ->with($entry, 'rule as string') ->willReturn(true); - $this->repository + $this->tagRepository ->expects($this->once()) ->method('findOneByLabelAndUserId') ->willReturn($tag); @@ -155,4 +157,11 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); } + + private function getEntryRepositoryMock() + { + return $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') + ->disableOriginalConstructor() + ->getMock(); + } } -- cgit v1.2.3