@@ 289-295 (lines=7) @@ | ||
286 | unset($_SERVER['PHP_AUTH_PW']); |
|
287 | } |
|
288 | ||
289 | public function testMethodNotAllowed() |
|
290 | { |
|
291 | $comment1 = $this->objFromFixture('RestfulServerTest_Comment', 'comment1'); |
|
292 | ||
293 | $url = "/api/v1/RestfulServerTest_Comment/" . $comment1->ID; |
|
294 | $response = Director::test($url, null, null, 'UNKNOWNHTTPMETHOD'); |
|
295 | $this->assertEquals($response->getStatusCode(), 405); |
|
296 | } |
|
297 | ||
298 | public function testConflictOnExistingResourceWhenUsingPost() |
|
@@ 298-304 (lines=7) @@ | ||
295 | $this->assertEquals($response->getStatusCode(), 405); |
|
296 | } |
|
297 | ||
298 | public function testConflictOnExistingResourceWhenUsingPost() |
|
299 | { |
|
300 | $rating1 = $this->objFromFixture('RestfulServerTest_AuthorRating', 'rating1'); |
|
301 | ||
302 | $url = "/api/v1/RestfulServerTest_AuthorRating/" . $rating1->ID; |
|
303 | $response = Director::test($url, null, null, 'POST'); |
|
304 | $this->assertEquals($response->getStatusCode(), 409); |
|
305 | } |
|
306 | ||
307 | public function testUnsupportedMediaType() |