diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php index 37e137bf..70951d46 100644 --- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | |||
@@ -121,6 +121,26 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase | |||
121 | $this->assertSame($tag, $tags[0]); | 121 | $this->assertSame($tag, $tags[0]); |
122 | } | 122 | } |
123 | 123 | ||
124 | public function testSameTagWithDifferentfMatchingRules() | ||
125 | { | ||
126 | $taggingRule = $this->getTaggingRule('bla bla', array('hey')); | ||
127 | $otherTaggingRule = $this->getTaggingRule('rule as string', array('hey')); | ||
128 | |||
129 | $user = $this->getUser([$taggingRule, $otherTaggingRule]); | ||
130 | $entry = new Entry($user); | ||
131 | |||
132 | $this->rulerz | ||
133 | ->method('satisfies') | ||
134 | ->willReturn(true); | ||
135 | |||
136 | $this->tagger->tag($entry); | ||
137 | |||
138 | $this->assertFalse($entry->getTags()->isEmpty()); | ||
139 | |||
140 | $tags = $entry->getTags(); | ||
141 | $this->assertCount(1, $tags); | ||
142 | } | ||
143 | |||
124 | private function getUser(array $taggingRules = []) | 144 | private function getUser(array $taggingRules = []) |
125 | { | 145 | { |
126 | $user = new User(); | 146 | $user = new User(); |