X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FTests%2FController%2FAnnotationControllerTest.php;h=3eba719384a7c690aca3405c301ded906deee214;hb=4094ea47712efbe58624ff74daeb1f77c9b0edcf;hp=e972c2deb22b8c0bb310757f05b04b0ee9bc7f64;hpb=b95ffda2a105af4c6f4f86aca025a0bf967bc86a;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php b/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php index e972c2de..3eba7193 100644 --- a/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php +++ b/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php @@ -35,13 +35,13 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase ->getRepository('WallabagCoreBundle:Entry') ->findOneByUsernameAndNotArchived('admin'); - $headers = array('CONTENT_TYPE' => 'application/json'); - $content = json_encode(array( + $headers = ['CONTENT_TYPE' => 'application/json']; + $content = json_encode([ 'text' => 'my annotation', 'quote' => 'my quote', - 'ranges' => array('start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31), - )); - $crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', array(), array(), $headers, $content); + 'ranges' => ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31], + ]); + $crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); @@ -69,11 +69,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase $this->logInAs('admin'); - $headers = array('CONTENT_TYPE' => 'application/json'); - $content = json_encode(array( + $headers = ['CONTENT_TYPE' => 'application/json']; + $content = json_encode([ 'text' => 'a modified annotation', - )); - $crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content); + ]); + $crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); @@ -99,11 +99,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase $this->logInAs('admin'); - $headers = array('CONTENT_TYPE' => 'application/json'); - $content = json_encode(array( + $headers = ['CONTENT_TYPE' => 'application/json']; + $content = json_encode([ 'text' => 'a modified annotation', - )); - $crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content); + ]); + $crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true);