summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-16 01:19:29 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-16 01:19:29 +0200
commit054aad5a6968c13b9580109c7df3129a1db6f8a4 (patch)
tree2e35e4374d3fd011859371174238c480b9c6ba0f
parentb485ec1da214e13ec5731df6a56072b3ed3aed23 (diff)
fix coding style and dead code
-rw-r--r--controller/pagecontroller.php6
-rw-r--r--js/config/protractor.js6
-rw-r--r--tests/unit/controller/FeedControllerTest.php8
-rw-r--r--tests/unit/controller/FolderApiControllerTest.php3
-rw-r--r--tests/unit/controller/ItemControllerTest.php2
-rw-r--r--tests/unit/controller/PageControllerTest.php19
6 files changed, 13 insertions, 31 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php
index 2e9377a7e..bdbbf13f0 100644
--- a/controller/pagecontroller.php
+++ b/controller/pagecontroller.php
@@ -76,10 +76,8 @@ class PageController extends Controller {
$settings = ['showAll', 'compact', 'preventReadOnScroll', 'oldestFirst'];
foreach ($settings as $setting) {
- if(${$setting} !== null) {
- $this->settings->setUserValue($this->userId, $this->appName,
- $setting, ${$setting});
- }
+ $this->settings->setUserValue($this->userId, $this->appName,
+ $setting, ${$setting});
}
}
diff --git a/js/config/protractor.js b/js/config/protractor.js
index 6193d5c99..313505476 100644
--- a/js/config/protractor.js
+++ b/js/config/protractor.js
@@ -20,11 +20,11 @@ exports.config = {
browser.findElement(By.id('password')).sendKeys('admin');
browser.findElement(By.id('submit')).click();
- browser.driver.wait(function() {
- return browser.driver.getCurrentUrl().then(function(url) {
+ browser.driver.wait(function () {
+ return browser.driver.getCurrentUrl().then(function (url) {
return /apps/.test(url);
});
});
},
baseUrl: baseUrl
-} \ No newline at end of file
+}; \ No newline at end of file
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