From 054aad5a6968c13b9580109c7df3129a1db6f8a4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 16 May 2014 01:19:29 +0200 Subject: fix coding style and dead code --- tests/unit/controller/FeedControllerTest.php | 8 ++++---- tests/unit/controller/FolderApiControllerTest.php | 3 +-- tests/unit/controller/ItemControllerTest.php | 2 +- tests/unit/controller/PageControllerTest.php | 19 ++----------------- 4 files changed, 8 insertions(+), 24 deletions(-) (limited to 'tests') diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index a2fc8bc22..c756875d2 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -426,11 +426,11 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase { $this->feedService->expects($this->once()) ->method('importArticles') - ->with($this->equalTo('json'), + ->with($this->equalTo(array('json')), $this->equalTo($this->user)) ->will($this->returnValue($feed)); - $response = $this->controller->import('json'); + $response = $this->controller->import(array('json')); $this->assertEquals($expected, $response); } @@ -439,11 +439,11 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase { public function testImportCreatesNoAdditionalFeed() { $this->feedService->expects($this->once()) ->method('importArticles') - ->with($this->equalTo('json'), + ->with($this->equalTo(array('json')), $this->equalTo($this->user)) ->will($this->returnValue(null)); - $response = $this->controller->import('json'); + $response = $this->controller->import(array('json')); $this->assertEquals([], $response); } diff --git a/tests/unit/controller/FolderApiControllerTest.php b/tests/unit/controller/FolderApiControllerTest.php index 8ddb9d14f..4a2c922b0 100644 --- a/tests/unit/controller/FolderApiControllerTest.php +++ b/tests/unit/controller/FolderApiControllerTest.php @@ -81,7 +81,6 @@ class FolderApiControllerTest extends \PHPUnit_Framework_TestCase { $folderName = 'test'; $folder = new Folder(); $folder->setName($folderName); - $folders = [$folder]; $this->folderService->expects($this->once()) ->method('purgeDeleted') @@ -139,7 +138,7 @@ class FolderApiControllerTest extends \PHPUnit_Framework_TestCase { ->method('delete') ->with($this->equalTo($folderId), $this->equalTo($this->user)); - $response = $this->folderAPI->delete(23); + $this->folderAPI->delete(23); } diff --git a/tests/unit/controller/ItemControllerTest.php b/tests/unit/controller/ItemControllerTest.php index 8756c6db0..a80b77990 100644 --- a/tests/unit/controller/ItemControllerTest.php +++ b/tests/unit/controller/ItemControllerTest.php @@ -278,7 +278,7 @@ class ItemControllerTest extends \PHPUnit_Framework_TestCase { $this->feedService->expects($this->never()) ->method('findAll'); - $response = $this->controller->index(FeedType::FEED, 2, 3, 10, true); + $response = $this->controller->index(FeedType::FEED, 2, 3, 10); $this->assertEquals($result, $response); } diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index 4789fcbe7..0e0959ea7 100644 --- a/tests/unit/controller/PageControllerTest.php +++ b/tests/unit/controller/PageControllerTest.php @@ -118,30 +118,15 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase { ->with($this->equalTo($this->user), $this->equalTo($this->appName), $this->equalTo('preventReadOnScroll'), - $this->equalTo(true)); + $this->equalTo(false)); $this->settings->expects($this->at(3)) ->method('setUserValue') ->with($this->equalTo($this->user), $this->equalTo($this->appName), $this->equalTo('oldestFirst'), $this->equalTo(true)); - $this->controller->updateSettings(true, true, true, true); + $this->controller->updateSettings(true, true, false, true); } - - public function testUpdateSettingsNoParameterShouldNotSetIt() { - $this->controller = new PageController($this->appName, $this->request, - $this->settings, $this->l10n, $this->user); - - $this->settings->expects($this->once()) - ->method('setUserValue') - ->with($this->equalTo($this->user), - $this->equalTo($this->appName), - $this->equalTo('showAll'), - $this->equalTo(true)); - - $this->controller->updateSettings(true, null, null, null); - - } } \ No newline at end of file -- cgit v1.2.3