Code Duplication    Length = 9-9 lines in 2 locations

tests/unit/RestfulServerTest.php 2 locations

@@ 350-358 (lines=9) @@
347
        unset($_SERVER['PHP_AUTH_PW']);
348
    }
349
350
    public function testMethodNotAllowed()
351
    {
352
        $comment1 = $this->objFromFixture(RestfulServerTestComment::class, 'comment1');
353
354
        $urlSafeClassname = $this->urlSafeClassname(RestfulServerTestComment::class);
355
        $url = "{$this->baseURI}/api/v1/$urlSafeClassname/" . $comment1->ID;
356
        $response = Director::test($url, null, null, 'UNKNOWNHTTPMETHOD');
357
        $this->assertEquals(405, $response->getStatusCode());
358
    }
359
360
    public function testConflictOnExistingResourceWhenUsingPost()
361
    {
@@ 360-368 (lines=9) @@
357
        $this->assertEquals(405, $response->getStatusCode());
358
    }
359
360
    public function testConflictOnExistingResourceWhenUsingPost()
361
    {
362
        $rating1 = $this->objFromFixture(RestfulServerTestAuthorRating::class, 'rating1');
363
364
        $urlSafeClassname = $this->urlSafeClassname(RestfulServerTestAuthorRating::class);
365
        $url = "{$this->baseURI}/api/v1/$urlSafeClassname/" . $rating1->ID;
366
        $response = Director::test($url, null, null, 'POST');
367
        $this->assertEquals(409, $response->getStatusCode());
368
    }
369
370
    public function testUnsupportedMediaType()
371
    {