aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
commitdad1c546a521159ca65a5a7649651d37728f0e55 (patch)
treef1d59eb83b45adb83bb21726374133a399d3c740 /src/Wallabag/CoreBundle/Tests
parent5432f6150939af6e7d2e8bf0faea0576491aaed0 (diff)
parent6be9750155fa731d75898b4973a126a090345c2d (diff)
downloadwallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.gz
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.zst
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.zip
Merge pull request #1545 from wallabag/v2-user-tag
v2 – Remove user reference in tag
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
index 1de134b8..dee17d65 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
@@ -69,9 +69,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
69 69
70 $tags = $entry->getTags(); 70 $tags = $entry->getTags();
71 $this->assertSame('foo', $tags[0]->getLabel()); 71 $this->assertSame('foo', $tags[0]->getLabel());
72 $this->assertSame($user, $tags[0]->getUser());
73 $this->assertSame('bar', $tags[1]->getLabel()); 72 $this->assertSame('bar', $tags[1]->getLabel());
74 $this->assertSame($user, $tags[1]->getUser());
75 } 73 }
76 74
77 public function testTagWithAMixOfMatchingRules() 75 public function testTagWithAMixOfMatchingRules()
@@ -92,7 +90,6 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
92 90
93 $tags = $entry->getTags(); 91 $tags = $entry->getTags();
94 $this->assertSame('foo', $tags[0]->getLabel()); 92 $this->assertSame('foo', $tags[0]->getLabel());
95 $this->assertSame($user, $tags[0]->getUser());
96 } 93 }
97 94
98 public function testWhenTheTagExists() 95 public function testWhenTheTagExists()
@@ -100,7 +97,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
100 $taggingRule = $this->getTaggingRule('rule as string', array('foo')); 97 $taggingRule = $this->getTaggingRule('rule as string', array('foo'));
101 $user = $this->getUser([$taggingRule]); 98 $user = $this->getUser([$taggingRule]);
102 $entry = new Entry($user); 99 $entry = new Entry($user);
103 $tag = new Tag($user); 100 $tag = new Tag();
104 101
105 $this->rulerz 102 $this->rulerz
106 ->expects($this->once()) 103 ->expects($this->once())
@@ -110,7 +107,9 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
110 107
111 $this->tagRepository 108 $this->tagRepository
112 ->expects($this->once()) 109 ->expects($this->once())
113 ->method('findOneByLabelAndUserId') 110 // the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method
111 // to magically call the `findOneBy` with ['label' => 'foo']
112 ->method('__call')
114 ->willReturn($tag); 113 ->willReturn($tag);
115 114
116 $this->tagger->tag($entry); 115 $this->tagger->tag($entry);