diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/external/NewsAPITest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/external/NewsAPITest.php b/tests/unit/external/NewsAPITest.php index e350f455f..dae2eb43f 100644 --- a/tests/unit/external/NewsAPITest.php +++ b/tests/unit/external/NewsAPITest.php @@ -91,4 +91,22 @@ class NewsAPITest extends ControllerTestUtility { } + public function testCorsAnnotations(){ + $annotations = array('IsAdminExemption', 'IsSubAdminExemption', + 'Ajax', 'CSRFExemption', 'IsLoggedInExemption'); + $this->assertAnnotations($this->newsAPI, 'cors', $annotations); + } + + + public function testCors() { + $response = $this->newsAPI->cors(); + + $headers = $response->getHeaders(); + + $this->assertEquals('*', $headers['Access-Control-Allow-Origin']); + $this->assertEquals('PUT, POST, GET, DELETE', $headers['Access-Control-Allow-Methods']); + $this->assertEquals('true', $headers['Access-Control-Allow-Credentials']); + } + + } |