summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Controller/PageControllerTest.php
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2020-10-10 00:23:15 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2020-10-10 10:26:12 +0200
commitb46c6df6322e09c05a34acca69403fd4ebd238ba (patch)
tree47182b11d97869304e97f729eacc490bc420d5df /tests/Unit/Controller/PageControllerTest.php
parenteb382ded61f608a4bb8d52a7a71478e461ca5be7 (diff)
Fix usage of at() in unittests
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'tests/Unit/Controller/PageControllerTest.php')
-rw-r--r--tests/Unit/Controller/PageControllerTest.php33
1 files changed, 13 insertions, 20 deletions
diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php
index fe263f242..2afe2d590 100644
--- a/tests/Unit/Controller/PageControllerTest.php
+++ b/tests/Unit/Controller/PageControllerTest.php
@@ -234,21 +234,15 @@ class PageControllerTest extends TestCase
*/
public function testUpdateSettings()
{
- $this->settings->expects($this->at(0))
- ->method('setUserValue')
- ->with('becka', 'news', 'showAll', '1');
- $this->settings->expects($this->at(1))
- ->method('setUserValue')
- ->with('becka', 'news', 'compact', '1');
- $this->settings->expects($this->at(2))
- ->method('setUserValue')
- ->with('becka', 'news', 'preventReadOnScroll', '0');
- $this->settings->expects($this->at(3))
- ->method('setUserValue')
- ->with('becka', 'news', 'oldestFirst', '1');
- $this->settings->expects($this->at(4))
+ $this->settings->expects($this->exactly(5))
->method('setUserValue')
- ->with('becka', 'news', 'compactExpand', '1');
+ ->withConsecutive(
+ ['becka', 'news', 'showAll', '1'],
+ ['becka', 'news', 'compact', '1'],
+ ['becka', 'news', 'preventReadOnScroll', '0'],
+ ['becka', 'news', 'oldestFirst', '1'],
+ ['becka', 'news', 'compactExpand', '1']
+ );
$this->controller->updateSettings(true, true, false, true, true);
}
@@ -256,13 +250,12 @@ class PageControllerTest extends TestCase
public function testExplore()
{
$in = ['test'];
- $this->settings->expects($this->at(0))
- ->method('setUserValue')
- ->with('becka', 'news', 'lastViewedFeedId', 0);
-
- $this->settings->expects($this->at(1))
+ $this->settings->expects($this->exactly(2))
->method('setUserValue')
- ->with('becka', 'news', 'lastViewedFeedType', FeedType::EXPLORE);
+ ->withConsecutive(
+ ['becka', 'news', 'lastViewedFeedId', 0],
+ ['becka', 'news', 'lastViewedFeedType', FeedType::EXPLORE]
+ );
$this->recommended->expects($this->once())
->method('forLanguage')