aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-07-01 09:52:38 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-07-01 09:52:38 +0200
commitf808b01692a835673f328d7221ba8c212caa9b61 (patch)
tree0c3b1fc5b1ddbd7af72227303503177689e1d403 /tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
parent822c877949aff8ae57677671115f8f4fc69588d5 (diff)
downloadwallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.gz
wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.zst
wallabag-f808b01692a835673f328d7221ba8c212caa9b61.zip
Add a real configuration for CS-Fixer
Diffstat (limited to 'tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php')
-rw-r--r--tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
index 3c94382c..96474468 100644
--- a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
+++ b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
@@ -49,12 +49,12 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
49 $this->logInAs('admin'); 49 $this->logInAs('admin');
50 } 50 }
51 51
52 $this->client->request('GET', $prefixUrl.'/'.$entry->getId().'.json'); 52 $this->client->request('GET', $prefixUrl . '/' . $entry->getId() . '.json');
53 $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); 53 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
54 54
55 $content = json_decode($this->client->getResponse()->getContent(), true); 55 $content = json_decode($this->client->getResponse()->getContent(), true);
56 $this->assertGreaterThanOrEqual(1, $content['total']); 56 $this->assertGreaterThanOrEqual(1, $content['total']);
57 $this->assertEquals($annotation->getText(), $content['rows'][0]['text']); 57 $this->assertSame($annotation->getText(), $content['rows'][0]['text']);
58 58
59 // we need to re-fetch the annotation becase after the flush, it has been "detached" from the entity manager 59 // we need to re-fetch the annotation becase after the flush, it has been "detached" from the entity manager
60 $annotation = $em->getRepository('WallabagAnnotationBundle:Annotation')->findAnnotationById($annotation->getId()); 60 $annotation = $em->getRepository('WallabagAnnotationBundle:Annotation')->findAnnotationById($annotation->getId());
@@ -88,16 +88,16 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
88 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31], 88 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
89 ], 89 ],
90 ]); 90 ]);
91 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content); 91 $this->client->request('POST', $prefixUrl . '/' . $entry->getId() . '.json', [], [], $headers, $content);
92 92
93 $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); 93 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
94 94
95 $content = json_decode($this->client->getResponse()->getContent(), true); 95 $content = json_decode($this->client->getResponse()->getContent(), true);
96 96
97 $this->assertEquals('Big boss', $content['user']); 97 $this->assertSame('Big boss', $content['user']);
98 $this->assertEquals('v1.0', $content['annotator_schema_version']); 98 $this->assertSame('v1.0', $content['annotator_schema_version']);
99 $this->assertEquals('my annotation', $content['text']); 99 $this->assertSame('my annotation', $content['text']);
100 $this->assertEquals('my quote', $content['quote']); 100 $this->assertSame('my quote', $content['quote']);
101 101
102 /** @var Annotation $annotation */ 102 /** @var Annotation $annotation */
103 $annotation = $this->client->getContainer() 103 $annotation = $this->client->getContainer()
@@ -105,7 +105,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
105 ->getRepository('WallabagAnnotationBundle:Annotation') 105 ->getRepository('WallabagAnnotationBundle:Annotation')
106 ->findLastAnnotationByPageId($entry->getId(), 1); 106 ->findLastAnnotationByPageId($entry->getId(), 1);
107 107
108 $this->assertEquals('my annotation', $annotation->getText()); 108 $this->assertSame('my annotation', $annotation->getText());
109 } 109 }
110 110
111 /** 111 /**
@@ -133,9 +133,9 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
133 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31], 133 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
134 ], 134 ],
135 ]); 135 ]);
136 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content); 136 $this->client->request('POST', $prefixUrl . '/' . $entry->getId() . '.json', [], [], $headers, $content);
137 137
138 $this->assertEquals(400, $this->client->getResponse()->getStatusCode()); 138 $this->assertSame(400, $this->client->getResponse()->getStatusCode());
139 } 139 }
140 140
141 /** 141 /**
@@ -166,21 +166,21 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
166 $content = json_encode([ 166 $content = json_encode([
167 'text' => 'a modified annotation', 167 'text' => 'a modified annotation',
168 ]); 168 ]);
169 $this->client->request('PUT', $prefixUrl.'/'.$annotation->getId().'.json', [], [], $headers, $content); 169 $this->client->request('PUT', $prefixUrl . '/' . $annotation->getId() . '.json', [], [], $headers, $content);
170 $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); 170 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
171 171
172 $content = json_decode($this->client->getResponse()->getContent(), true); 172 $content = json_decode($this->client->getResponse()->getContent(), true);
173 173
174 $this->assertEquals('Big boss', $content['user']); 174 $this->assertSame('Big boss', $content['user']);
175 $this->assertEquals('v1.0', $content['annotator_schema_version']); 175 $this->assertSame('v1.0', $content['annotator_schema_version']);
176 $this->assertEquals('a modified annotation', $content['text']); 176 $this->assertSame('a modified annotation', $content['text']);
177 $this->assertEquals('my quote', $content['quote']); 177 $this->assertSame('my quote', $content['quote']);
178 178
179 /** @var Annotation $annotationUpdated */ 179 /** @var Annotation $annotationUpdated */
180 $annotationUpdated = $em 180 $annotationUpdated = $em
181 ->getRepository('WallabagAnnotationBundle:Annotation') 181 ->getRepository('WallabagAnnotationBundle:Annotation')
182 ->findOneById($annotation->getId()); 182 ->findOneById($annotation->getId());
183 $this->assertEquals('a modified annotation', $annotationUpdated->getText()); 183 $this->assertSame('a modified annotation', $annotationUpdated->getText());
184 184
185 $em->remove($annotationUpdated); 185 $em->remove($annotationUpdated);
186 $em->flush(); 186 $em->flush();
@@ -218,12 +218,12 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
218 $content = json_encode([ 218 $content = json_encode([
219 'text' => 'a modified annotation', 219 'text' => 'a modified annotation',
220 ]); 220 ]);
221 $this->client->request('DELETE', $prefixUrl.'/'.$annotation->getId().'.json', [], [], $headers, $content); 221 $this->client->request('DELETE', $prefixUrl . '/' . $annotation->getId() . '.json', [], [], $headers, $content);
222 $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); 222 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
223 223
224 $content = json_decode($this->client->getResponse()->getContent(), true); 224 $content = json_decode($this->client->getResponse()->getContent(), true);
225 225
226 $this->assertEquals('This is my annotation /o/', $content['text']); 226 $this->assertSame('This is my annotation /o/', $content['text']);
227 227
228 $annotationDeleted = $em 228 $annotationDeleted = $em
229 ->getRepository('WallabagAnnotationBundle:Annotation') 229 ->getRepository('WallabagAnnotationBundle:Annotation')