diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-07-03 13:39:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 13:39:54 +0200 |
commit | 71e1cbc8eb5928d393b0772055d6b711e90a09b3 (patch) | |
tree | 71795eadcf13fda9198b8cd9a3da26d51826bbd9 /tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
parent | 38520658addc217f127b0627ea28dcf8d6e6178c (diff) | |
download | wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.gz wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.zst wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.zip |
Merge pull request #3258 from wallabag/cs-fixer
Add a real configuration for CS-Fixer
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php index 7f69bd67..430e548d 100644 --- a/tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php | |||
@@ -11,7 +11,7 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
11 | { | 11 | { |
12 | $this->client->request('GET', '/api/tags.json'); | 12 | $this->client->request('GET', '/api/tags.json'); |
13 | 13 | ||
14 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 14 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); |
15 | 15 | ||
16 | $content = json_decode($this->client->getResponse()->getContent(), true); | 16 | $content = json_decode($this->client->getResponse()->getContent(), true); |
17 | 17 | ||
@@ -33,15 +33,15 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
33 | $em->flush(); | 33 | $em->flush(); |
34 | $em->clear(); | 34 | $em->clear(); |
35 | 35 | ||
36 | $this->client->request('DELETE', '/api/tags/'.$tag->getId().'.json'); | 36 | $this->client->request('DELETE', '/api/tags/' . $tag->getId() . '.json'); |
37 | 37 | ||
38 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 38 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); |
39 | 39 | ||
40 | $content = json_decode($this->client->getResponse()->getContent(), true); | 40 | $content = json_decode($this->client->getResponse()->getContent(), true); |
41 | 41 | ||
42 | $this->assertArrayHasKey('label', $content); | 42 | $this->assertArrayHasKey('label', $content); |
43 | $this->assertEquals($tag->getLabel(), $content['label']); | 43 | $this->assertSame($tag->getLabel(), $content['label']); |
44 | $this->assertEquals($tag->getSlug(), $content['slug']); | 44 | $this->assertSame($tag->getSlug(), $content['slug']); |
45 | 45 | ||
46 | $entries = $em->getRepository('WallabagCoreBundle:Entry') | 46 | $entries = $em->getRepository('WallabagCoreBundle:Entry') |
47 | ->findAllByTagId($this->user->getId(), $tag->getId()); | 47 | ->findAllByTagId($this->user->getId(), $tag->getId()); |
@@ -50,7 +50,7 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
50 | 50 | ||
51 | $tag = $em->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel); | 51 | $tag = $em->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel); |
52 | 52 | ||
53 | $this->assertNull($tag, $tagLabel.' was removed because it begun an orphan tag'); | 53 | $this->assertNull($tag, $tagLabel . ' was removed because it begun an orphan tag'); |
54 | } | 54 | } |
55 | 55 | ||
56 | public function dataForDeletingTagByLabel() | 56 | public function dataForDeletingTagByLabel() |
@@ -84,18 +84,18 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
84 | $em->flush(); | 84 | $em->flush(); |
85 | 85 | ||
86 | if ($useQueryString) { | 86 | if ($useQueryString) { |
87 | $this->client->request('DELETE', '/api/tag/label.json?tag='.$tag->getLabel()); | 87 | $this->client->request('DELETE', '/api/tag/label.json?tag=' . $tag->getLabel()); |
88 | } else { | 88 | } else { |
89 | $this->client->request('DELETE', '/api/tag/label.json', ['tag' => $tag->getLabel()]); | 89 | $this->client->request('DELETE', '/api/tag/label.json', ['tag' => $tag->getLabel()]); |
90 | } | 90 | } |
91 | 91 | ||
92 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 92 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); |
93 | 93 | ||
94 | $content = json_decode($this->client->getResponse()->getContent(), true); | 94 | $content = json_decode($this->client->getResponse()->getContent(), true); |
95 | 95 | ||
96 | $this->assertArrayHasKey('label', $content); | 96 | $this->assertArrayHasKey('label', $content); |
97 | $this->assertEquals($tag->getLabel(), $content['label']); | 97 | $this->assertSame($tag->getLabel(), $content['label']); |
98 | $this->assertEquals($tag->getSlug(), $content['slug']); | 98 | $this->assertSame($tag->getSlug(), $content['slug']); |
99 | 99 | ||
100 | $entries = $this->client->getContainer() | 100 | $entries = $this->client->getContainer() |
101 | ->get('doctrine.orm.entity_manager') | 101 | ->get('doctrine.orm.entity_manager') |
@@ -109,7 +109,7 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
109 | { | 109 | { |
110 | $this->client->request('DELETE', '/api/tag/label.json', ['tag' => 'does not exist']); | 110 | $this->client->request('DELETE', '/api/tag/label.json', ['tag' => 'does not exist']); |
111 | 111 | ||
112 | $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); | 112 | $this->assertSame(404, $this->client->getResponse()->getStatusCode()); |
113 | } | 113 | } |
114 | 114 | ||
115 | /** | 115 | /** |
@@ -140,24 +140,24 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
140 | $em->flush(); | 140 | $em->flush(); |
141 | 141 | ||
142 | if ($useQueryString) { | 142 | if ($useQueryString) { |
143 | $this->client->request('DELETE', '/api/tags/label.json?tags='.$tag->getLabel().','.$tag2->getLabel()); | 143 | $this->client->request('DELETE', '/api/tags/label.json?tags=' . $tag->getLabel() . ',' . $tag2->getLabel()); |
144 | } else { | 144 | } else { |
145 | $this->client->request('DELETE', '/api/tags/label.json', ['tags' => $tag->getLabel().','.$tag2->getLabel()]); | 145 | $this->client->request('DELETE', '/api/tags/label.json', ['tags' => $tag->getLabel() . ',' . $tag2->getLabel()]); |
146 | } | 146 | } |
147 | 147 | ||
148 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 148 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); |
149 | 149 | ||
150 | $content = json_decode($this->client->getResponse()->getContent(), true); | 150 | $content = json_decode($this->client->getResponse()->getContent(), true); |
151 | 151 | ||
152 | $this->assertCount(2, $content); | 152 | $this->assertCount(2, $content); |
153 | 153 | ||
154 | $this->assertArrayHasKey('label', $content[0]); | 154 | $this->assertArrayHasKey('label', $content[0]); |
155 | $this->assertEquals($tag->getLabel(), $content[0]['label']); | 155 | $this->assertSame($tag->getLabel(), $content[0]['label']); |
156 | $this->assertEquals($tag->getSlug(), $content[0]['slug']); | 156 | $this->assertSame($tag->getSlug(), $content[0]['slug']); |
157 | 157 | ||
158 | $this->assertArrayHasKey('label', $content[1]); | 158 | $this->assertArrayHasKey('label', $content[1]); |
159 | $this->assertEquals($tag2->getLabel(), $content[1]['label']); | 159 | $this->assertSame($tag2->getLabel(), $content[1]['label']); |
160 | $this->assertEquals($tag2->getSlug(), $content[1]['slug']); | 160 | $this->assertSame($tag2->getSlug(), $content[1]['slug']); |
161 | 161 | ||
162 | $entries = $this->client->getContainer() | 162 | $entries = $this->client->getContainer() |
163 | ->get('doctrine.orm.entity_manager') | 163 | ->get('doctrine.orm.entity_manager') |
@@ -178,6 +178,6 @@ class TagRestControllerTest extends WallabagApiTestCase | |||
178 | { | 178 | { |
179 | $this->client->request('DELETE', '/api/tags/label.json', ['tags' => 'does not exist']); | 179 | $this->client->request('DELETE', '/api/tags/label.json', ['tags' => 'does not exist']); |
180 | 180 | ||
181 | $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); | 181 | $this->assertSame(404, $this->client->getResponse()->getStatusCode()); |
182 | } | 182 | } |
183 | } | 183 | } |