summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-09-02 15:46:37 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-09-02 15:46:37 +0200
commit01e4a7a82429079a222972c907d02f9eb04a9e93 (patch)
tree6bad731bcd687f4686f6b4f0b8802bb7738f2f24
parent479d5e2e377e9c5daaea3359f84b563ac3ca5825 (diff)
fix updater cleanup route
-rw-r--r--appinfo/routes.php2
-rw-r--r--external/newsapi.php1
-rw-r--r--tests/unit/external/NewsAPITest.php3
3 files changed, 4 insertions, 2 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 6ceaf94e1..617b63c53 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -233,7 +233,7 @@ $this->create('news_api_version', '/api/v1-2/version')->get()->action(
}
);
-$this->create('news_api_cleanup', '/api/v1-2/cleanUp')->get()->action(
+$this->create('news_api_cleanup', '/api/v1-2/cleanup')->get()->action(
function($params) {
return App::main('NewsAPI', 'cleanUp', $params, new DIContainer());
}
diff --git a/external/newsapi.php b/external/newsapi.php
index c5fd5e567..f0f49f9da 100644
--- a/external/newsapi.php
+++ b/external/newsapi.php
@@ -67,6 +67,7 @@ class NewsAPI extends Controller {
*/
public function cleanUp() {
$this->updater->cleanUp();
+ return new JSONResponse();
}
diff --git a/tests/unit/external/NewsAPITest.php b/tests/unit/external/NewsAPITest.php
index 9a319a378..116418fc6 100644
--- a/tests/unit/external/NewsAPITest.php
+++ b/tests/unit/external/NewsAPITest.php
@@ -88,7 +88,8 @@ class NewsAPITest extends ControllerTestUtility {
public function testCleanUp(){
$this->updater->expects($this->once())
->method('cleanUp');
- $this->newsAPI->cleanUp();
+ $response = $this->newsAPI->cleanUp();
+ $this->assertTrue($response instanceof JSONResponse);
}