diff options
author | Kévin Gomez <contact@kevingomez.fr> | 2015-10-24 15:11:06 +0200 |
---|---|---|
committer | Kévin Gomez <contact@kevingomez.fr> | 2015-11-11 16:27:19 +0100 |
commit | 625acf335298186b4ff983f9321900d1238e854b (patch) | |
tree | bc3149d9cee320429475ced6a1cb8b53c71ad7eb /src/Wallabag/CoreBundle/Tests | |
parent | cad8cda7af06234a63b86253da1d813e7b0fd0f2 (diff) | |
download | wallabag-625acf335298186b4ff983f9321900d1238e854b.tar.gz wallabag-625acf335298186b4ff983f9321900d1238e854b.tar.zst wallabag-625acf335298186b4ff983f9321900d1238e854b.zip |
Add a command to automatically tag all entries for a user
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | 19 |
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; | |||
12 | class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase | 12 | class 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 | } |