From 73c02fdaa62dba2f7d6afa2a8eaad6a04b5634d4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 12 Jun 2013 20:32:39 +0200 Subject: adjust routes for new api --- tests/unit/external/FeedAPITest.php | 5 ++-- tests/unit/external/FolderAPITest.php | 3 +- tests/unit/external/ItemAPITest.php | 3 +- tests/unit/external/NewsAPIResultTest.php | 49 ------------------------------- tests/unit/external/NewsAPITest.php | 3 +- 5 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 tests/unit/external/NewsAPIResultTest.php (limited to 'tests') 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 @@ -. -* -*/ - -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); } -- cgit v1.2.3