diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php index 70951d46..1de134b8 100644 --- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | |||
@@ -141,6 +141,32 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase | |||
141 | $this->assertCount(1, $tags); | 141 | $this->assertCount(1, $tags); |
142 | } | 142 | } |
143 | 143 | ||
144 | public function testTagAllEntriesForAUser() | ||
145 | { | ||
146 | $taggingRule = $this->getTaggingRule('bla bla', array('hey')); | ||
147 | |||
148 | $user = $this->getUser([$taggingRule]); | ||
149 | |||
150 | $this->rulerz | ||
151 | ->method('satisfies') | ||
152 | ->willReturn(true); | ||
153 | |||
154 | $this->rulerz | ||
155 | ->method('filter') | ||
156 | ->willReturn(array(new Entry($user), new Entry($user))); | ||
157 | |||
158 | $entries = $this->tagger->tagAllForUser($user); | ||
159 | |||
160 | $this->assertCount(2, $entries); | ||
161 | |||
162 | foreach ($entries as $entry) { | ||
163 | $tags = $entry->getTags(); | ||
164 | |||
165 | $this->assertCount(1, $tags); | ||
166 | $this->assertEquals('hey', $tags[0]->getLabel()); | ||
167 | } | ||
168 | } | ||
169 | |||
144 | private function getUser(array $taggingRules = []) | 170 | private function getUser(array $taggingRules = []) |
145 | { | 171 | { |
146 | $user = new User(); | 172 | $user = new User(); |