summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-06-12 20:32:39 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-06-12 20:32:49 +0200
commit73c02fdaa62dba2f7d6afa2a8eaad6a04b5634d4 (patch)
tree557ba1b4067212f4826927197272542a2091fd3e /tests
parent836c65b6fa7e9a90f9baf421713641dfcb7a90aa (diff)
adjust routes for new api
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/external/FeedAPITest.php5
-rw-r--r--tests/unit/external/FolderAPITest.php3
-rw-r--r--tests/unit/external/ItemAPITest.php3
-rw-r--r--tests/unit/external/NewsAPIResultTest.php49
-rw-r--r--tests/unit/external/NewsAPITest.php3
5 files changed, 9 insertions, 54 deletions
diff --git a/tests/unit/external/FeedAPITest.php b/tests/unit/external/FeedAPITest.php
index b4ab8bfe6..9b9d02514 100644
--- a/tests/unit/external/FeedAPITest.php
+++ b/tests/unit/external/FeedAPITest.php
@@ -84,7 +84,8 @@ class FeedAPITest extends ControllerTestUtility {
private function assertDefaultAnnotations($methodName){
- $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax');
+ $annotations = array('IsAdminExemption', 'IsSubAdminExemption',
+ 'Ajax', 'CSRFExemption');
$this->assertAnnotations($this->feedAPI, $methodName, $annotations);
}
@@ -336,7 +337,7 @@ class FeedAPITest extends ControllerTestUtility {
$data = $response->getData();
$this->assertEquals($this->msg, $data['message']);
- $this->assertEquals(NewsAPIResult::EXISTS_ERROR, $response->getStatus());
+ $this->assertEquals(Http::STATUS_CONFLICT, $response->getStatus());
}
diff --git a/tests/unit/external/FolderAPITest.php b/tests/unit/external/FolderAPITest.php
index f20cf0ccf..60ab40a81 100644
--- a/tests/unit/external/FolderAPITest.php
+++ b/tests/unit/external/FolderAPITest.php
@@ -79,7 +79,8 @@ class FolderAPITest extends ControllerTestUtility {
private function assertDefaultAnnotations($methodName){
- $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax');
+ $annotations = array('IsAdminExemption', 'IsSubAdminExemption',
+ 'Ajax', 'CSRFExemption');
$this->assertAnnotations($this->folderAPI, $methodName, $annotations);
}
diff --git a/tests/unit/external/ItemAPITest.php b/tests/unit/external/ItemAPITest.php
index f20e38b25..f2533b4fa 100644
--- a/tests/unit/external/ItemAPITest.php
+++ b/tests/unit/external/ItemAPITest.php
@@ -69,7 +69,8 @@ class ItemAPITest extends ControllerTestUtility {
private function assertDefaultAnnotations($methodName){
- $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax');
+ $annotations = array('IsAdminExemption', 'IsSubAdminExemption',
+ 'Ajax', 'CSRFExemption');
$this->assertAnnotations($this->itemAPI, $methodName, $annotations);
}
diff --git a/tests/unit/external/NewsAPIResultTest.php b/tests/unit/external/NewsAPIResultTest.php
deleted file mode 100644
index 6d0e41669..000000000
--- a/tests/unit/external/NewsAPIResultTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-/**
-* ownCloud - News
-*
-* @author Alessandro Cosentino
-* @author Bernhard Posselt
-* @copyright 2012 Alessandro Cosentino cosenal@gmail.com
-* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-namespace OCA\News\External;
-
-require_once(__DIR__ . "/../../classloader.php");
-
-
-class NewsAPIResultTest extends \PHPUnit_Framework_TestCase {
-
-
- public function testExistsError(){
- $result = new NewsAPIResult(null, NewsAPIResult::EXISTS_ERROR, 'hi');
- $this->assertEquals(409, $result->getStatusCode());
- $this->assertEquals('hi', $result->getMessage());
- }
-
-
- public function testNoInput(){
- $result = new NewsAPIResult();
- $this->assertNull($result->getData());
- $this->assertEquals(100, $result->getStatusCode());
- $this->assertNull($result->getMessage());
- }
-
-
-}
diff --git a/tests/unit/external/NewsAPITest.php b/tests/unit/external/NewsAPITest.php
index 07ba00a1e..3cccd62ff 100644
--- a/tests/unit/external/NewsAPITest.php
+++ b/tests/unit/external/NewsAPITest.php
@@ -51,7 +51,8 @@ class NewsAPITest extends ControllerTestUtility {
private function assertDefaultAnnotations($methodName){
- $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax');
+ $annotations = array('IsAdminExemption', 'IsSubAdminExemption',
+ 'Ajax', 'CSRFExemption');
$this->assertAnnotations($this->newsAPI, $methodName, $annotations);
}