aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php19
1 files changed, 14 insertions, 5 deletions
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;
12class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase 12class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
13{ 13{
14 private $rulerz; 14 private $rulerz;
15 private $repository; 15 private $tagRepository;
16 private $entryRepository;
16 private $tagger; 17 private $tagger;
17 18
18 public function setUp() 19 public function setUp()
19 { 20 {
20 $this->rulerz = $this->getRulerZMock(); 21 $this->rulerz = $this->getRulerZMock();
21 $this->repository = $this->getTagRepositoryMock(); 22 $this->tagRepository = $this->getTagRepositoryMock();
23 $this->entryRepository = $this->getEntryRepositoryMock();
22 24
23 $this->tagger = new RuleBasedTagger($this->rulerz, $this->repository); 25 $this->tagger = new RuleBasedTagger($this->rulerz, $this->tagRepository, $this->entryRepository);
24 } 26 }
25 27
26 public function testTagWithNoRule() 28 public function testTagWithNoRule()
@@ -106,7 +108,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
106 ->with($entry, 'rule as string') 108 ->with($entry, 'rule as string')
107 ->willReturn(true); 109 ->willReturn(true);
108 110
109 $this->repository 111 $this->tagRepository
110 ->expects($this->once()) 112 ->expects($this->once())
111 ->method('findOneByLabelAndUserId') 113 ->method('findOneByLabelAndUserId')
112 ->willReturn($tag); 114 ->willReturn($tag);
@@ -155,4 +157,11 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
155 ->disableOriginalConstructor() 157 ->disableOriginalConstructor()
156 ->getMock(); 158 ->getMock();
157 } 159 }
160
161 private function getEntryRepositoryMock()
162 {
163 return $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
164 ->disableOriginalConstructor()
165 ->getMock();
166 }
158} 167}