diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-12-29 14:50:52 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-12-29 14:50:52 +0100 |
commit | fc73222723c7a0c9b577805d3ef51eb96b124b92 (patch) | |
tree | 002b77b82266b1e497e3683e72f4a457d4353633 /src/Wallabag/CoreBundle/Tests | |
parent | c997cfcc9c161241a6398b0942a1a869688d807a (diff) | |
download | wallabag-fc73222723c7a0c9b577805d3ef51eb96b124b92.tar.gz wallabag-fc73222723c7a0c9b577805d3ef51eb96b124b92.tar.zst wallabag-fc73222723c7a0c9b577805d3ef51eb96b124b92.zip |
Remove user reference in tag
Fix #1543
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 4 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 7b32354f..89ca31e2 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | |||
@@ -44,7 +44,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
44 | $form = $crawler->filter('button[id=config_save]')->form(); | 44 | $form = $crawler->filter('button[id=config_save]')->form(); |
45 | 45 | ||
46 | $data = array( | 46 | $data = array( |
47 | 'config[theme]' => 0, | 47 | 'config[theme]' => 'baggy', |
48 | 'config[items_per_page]' => '30', | 48 | 'config[items_per_page]' => '30', |
49 | 'config[language]' => 'en', | 49 | 'config[language]' => 'en', |
50 | ); | 50 | ); |
@@ -63,7 +63,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
63 | { | 63 | { |
64 | return array( | 64 | return array( |
65 | array(array( | 65 | array(array( |
66 | 'config[theme]' => 0, | 66 | 'config[theme]' => 'baggy', |
67 | 'config[items_per_page]' => '', | 67 | 'config[items_per_page]' => '', |
68 | 'config[language]' => 'en', | 68 | 'config[language]' => 'en', |
69 | )), | 69 | )), |
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php index 1de134b8..cddc8b08 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,8 @@ 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(); |
101 | $tag->setLabel('foo'); | ||
104 | 102 | ||
105 | $this->rulerz | 103 | $this->rulerz |
106 | ->expects($this->once()) | 104 | ->expects($this->once()) |
@@ -110,7 +108,9 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase | |||
110 | 108 | ||
111 | $this->tagRepository | 109 | $this->tagRepository |
112 | ->expects($this->once()) | 110 | ->expects($this->once()) |
113 | ->method('findOneByLabelAndUserId') | 111 | // the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method |
112 | // to magically call the `findOneBy` with ['label' => 'foo'] | ||
113 | ->method('__call') | ||
114 | ->willReturn($tag); | 114 | ->willReturn($tag); |
115 | 115 | ||
116 | $this->tagger->tag($entry); | 116 | $this->tagger->tag($entry); |
@@ -118,7 +118,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase | |||
118 | $this->assertFalse($entry->getTags()->isEmpty()); | 118 | $this->assertFalse($entry->getTags()->isEmpty()); |
119 | 119 | ||
120 | $tags = $entry->getTags(); | 120 | $tags = $entry->getTags(); |
121 | $this->assertSame($tag, $tags[0]); | 121 | $this->assertSame($tag->getLabel(), $tags[0]->getLabel()); |
122 | } | 122 | } |
123 | 123 | ||
124 | public function testSameTagWithDifferentfMatchingRules() | 124 | public function testSameTagWithDifferentfMatchingRules() |