diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller')
5 files changed, 163 insertions, 163 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index f2d26750..1aa1a7ed 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | |||
@@ -43,12 +43,12 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
43 | 43 | ||
44 | $form = $crawler->filter('button[id=config_save]')->form(); | 44 | $form = $crawler->filter('button[id=config_save]')->form(); |
45 | 45 | ||
46 | $data = array( | 46 | $data = [ |
47 | 'config[theme]' => 'baggy', | 47 | 'config[theme]' => 'baggy', |
48 | 'config[items_per_page]' => '30', | 48 | 'config[items_per_page]' => '30', |
49 | 'config[reading_speed]' => '0.5', | 49 | 'config[reading_speed]' => '0.5', |
50 | 'config[language]' => 'en', | 50 | 'config[language]' => 'en', |
51 | ); | 51 | ]; |
52 | 52 | ||
53 | $client->submit($form, $data); | 53 | $client->submit($form, $data); |
54 | 54 | ||
@@ -56,19 +56,19 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
56 | 56 | ||
57 | $crawler = $client->followRedirect(); | 57 | $crawler = $client->followRedirect(); |
58 | 58 | ||
59 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 59 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
60 | $this->assertContains('flashes.config.notice.config_saved', $alert[0]); | 60 | $this->assertContains('flashes.config.notice.config_saved', $alert[0]); |
61 | } | 61 | } |
62 | 62 | ||
63 | public function dataForUpdateFailed() | 63 | public function dataForUpdateFailed() |
64 | { | 64 | { |
65 | return array( | 65 | return [ |
66 | array(array( | 66 | [[ |
67 | 'config[theme]' => 'baggy', | 67 | 'config[theme]' => 'baggy', |
68 | 'config[items_per_page]' => '', | 68 | 'config[items_per_page]' => '', |
69 | 'config[language]' => 'en', | 69 | 'config[language]' => 'en', |
70 | )), | 70 | ]], |
71 | ); | 71 | ]; |
72 | } | 72 | } |
73 | 73 | ||
74 | /** | 74 | /** |
@@ -89,46 +89,46 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
89 | 89 | ||
90 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 90 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
91 | 91 | ||
92 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 92 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
93 | $this->assertContains('This value should not be blank', $alert[0]); | 93 | $this->assertContains('This value should not be blank', $alert[0]); |
94 | } | 94 | } |
95 | 95 | ||
96 | public function dataForChangePasswordFailed() | 96 | public function dataForChangePasswordFailed() |
97 | { | 97 | { |
98 | return array( | 98 | return [ |
99 | array( | 99 | [ |
100 | array( | 100 | [ |
101 | 'change_passwd[old_password]' => 'material', | 101 | 'change_passwd[old_password]' => 'material', |
102 | 'change_passwd[new_password][first]' => '', | 102 | 'change_passwd[new_password][first]' => '', |
103 | 'change_passwd[new_password][second]' => '', | 103 | 'change_passwd[new_password][second]' => '', |
104 | ), | 104 | ], |
105 | 'validator.password_wrong_value', | 105 | 'validator.password_wrong_value', |
106 | ), | 106 | ], |
107 | array( | 107 | [ |
108 | array( | 108 | [ |
109 | 'change_passwd[old_password]' => 'mypassword', | 109 | 'change_passwd[old_password]' => 'mypassword', |
110 | 'change_passwd[new_password][first]' => '', | 110 | 'change_passwd[new_password][first]' => '', |
111 | 'change_passwd[new_password][second]' => '', | 111 | 'change_passwd[new_password][second]' => '', |
112 | ), | 112 | ], |
113 | 'This value should not be blank', | 113 | 'This value should not be blank', |
114 | ), | 114 | ], |
115 | array( | 115 | [ |
116 | array( | 116 | [ |
117 | 'change_passwd[old_password]' => 'mypassword', | 117 | 'change_passwd[old_password]' => 'mypassword', |
118 | 'change_passwd[new_password][first]' => 'hop', | 118 | 'change_passwd[new_password][first]' => 'hop', |
119 | 'change_passwd[new_password][second]' => '', | 119 | 'change_passwd[new_password][second]' => '', |
120 | ), | 120 | ], |
121 | 'validator.password_must_match', | 121 | 'validator.password_must_match', |
122 | ), | 122 | ], |
123 | array( | 123 | [ |
124 | array( | 124 | [ |
125 | 'change_passwd[old_password]' => 'mypassword', | 125 | 'change_passwd[old_password]' => 'mypassword', |
126 | 'change_passwd[new_password][first]' => 'hop', | 126 | 'change_passwd[new_password][first]' => 'hop', |
127 | 'change_passwd[new_password][second]' => 'hop', | 127 | 'change_passwd[new_password][second]' => 'hop', |
128 | ), | 128 | ], |
129 | 'validator.password_too_short', | 129 | 'validator.password_too_short', |
130 | ), | 130 | ], |
131 | ); | 131 | ]; |
132 | } | 132 | } |
133 | 133 | ||
134 | /** | 134 | /** |
@@ -149,7 +149,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
149 | 149 | ||
150 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 150 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
151 | 151 | ||
152 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 152 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
153 | $this->assertContains($expectedMessage, $alert[0]); | 153 | $this->assertContains($expectedMessage, $alert[0]); |
154 | } | 154 | } |
155 | 155 | ||
@@ -164,11 +164,11 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
164 | 164 | ||
165 | $form = $crawler->filter('button[id=change_passwd_save]')->form(); | 165 | $form = $crawler->filter('button[id=change_passwd_save]')->form(); |
166 | 166 | ||
167 | $data = array( | 167 | $data = [ |
168 | 'change_passwd[old_password]' => 'mypassword', | 168 | 'change_passwd[old_password]' => 'mypassword', |
169 | 'change_passwd[new_password][first]' => 'mypassword', | 169 | 'change_passwd[new_password][first]' => 'mypassword', |
170 | 'change_passwd[new_password][second]' => 'mypassword', | 170 | 'change_passwd[new_password][second]' => 'mypassword', |
171 | ); | 171 | ]; |
172 | 172 | ||
173 | $client->submit($form, $data); | 173 | $client->submit($form, $data); |
174 | 174 | ||
@@ -176,28 +176,28 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
176 | 176 | ||
177 | $crawler = $client->followRedirect(); | 177 | $crawler = $client->followRedirect(); |
178 | 178 | ||
179 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 179 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
180 | $this->assertContains('flashes.config.notice.password_updated', $alert[0]); | 180 | $this->assertContains('flashes.config.notice.password_updated', $alert[0]); |
181 | } | 181 | } |
182 | 182 | ||
183 | public function dataForUserFailed() | 183 | public function dataForUserFailed() |
184 | { | 184 | { |
185 | return array( | 185 | return [ |
186 | array( | 186 | [ |
187 | array( | 187 | [ |
188 | 'update_user[name]' => '', | 188 | 'update_user[name]' => '', |
189 | 'update_user[email]' => '', | 189 | 'update_user[email]' => '', |
190 | ), | 190 | ], |
191 | 'fos_user.email.blank', | 191 | 'fos_user.email.blank', |
192 | ), | 192 | ], |
193 | array( | 193 | [ |
194 | array( | 194 | [ |
195 | 'update_user[name]' => '', | 195 | 'update_user[name]' => '', |
196 | 'update_user[email]' => 'test', | 196 | 'update_user[email]' => 'test', |
197 | ), | 197 | ], |
198 | 'fos_user.email.invalid', | 198 | 'fos_user.email.invalid', |
199 | ), | 199 | ], |
200 | ); | 200 | ]; |
201 | } | 201 | } |
202 | 202 | ||
203 | /** | 203 | /** |
@@ -218,7 +218,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
218 | 218 | ||
219 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 219 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
220 | 220 | ||
221 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 221 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
222 | $this->assertContains($expectedMessage, $alert[0]); | 222 | $this->assertContains($expectedMessage, $alert[0]); |
223 | } | 223 | } |
224 | 224 | ||
@@ -233,10 +233,10 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
233 | 233 | ||
234 | $form = $crawler->filter('button[id=update_user_save]')->form(); | 234 | $form = $crawler->filter('button[id=update_user_save]')->form(); |
235 | 235 | ||
236 | $data = array( | 236 | $data = [ |
237 | 'update_user[name]' => 'new name', | 237 | 'update_user[name]' => 'new name', |
238 | 'update_user[email]' => 'admin@wallabag.io', | 238 | 'update_user[email]' => 'admin@wallabag.io', |
239 | ); | 239 | ]; |
240 | 240 | ||
241 | $client->submit($form, $data); | 241 | $client->submit($form, $data); |
242 | 242 | ||
@@ -244,59 +244,59 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
244 | 244 | ||
245 | $crawler = $client->followRedirect(); | 245 | $crawler = $client->followRedirect(); |
246 | 246 | ||
247 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 247 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
248 | $this->assertContains('flashes.config.notice.user_updated', $alert[0]); | 248 | $this->assertContains('flashes.config.notice.user_updated', $alert[0]); |
249 | } | 249 | } |
250 | 250 | ||
251 | public function dataForNewUserFailed() | 251 | public function dataForNewUserFailed() |
252 | { | 252 | { |
253 | return array( | 253 | return [ |
254 | array( | 254 | [ |
255 | array( | 255 | [ |
256 | 'new_user[username]' => '', | 256 | 'new_user[username]' => '', |
257 | 'new_user[plainPassword][first]' => '', | 257 | 'new_user[plainPassword][first]' => '', |
258 | 'new_user[plainPassword][second]' => '', | 258 | 'new_user[plainPassword][second]' => '', |
259 | 'new_user[email]' => '', | 259 | 'new_user[email]' => '', |
260 | ), | 260 | ], |
261 | 'fos_user.username.blank', | 261 | 'fos_user.username.blank', |
262 | ), | 262 | ], |
263 | array( | 263 | [ |
264 | array( | 264 | [ |
265 | 'new_user[username]' => 'a', | 265 | 'new_user[username]' => 'a', |
266 | 'new_user[plainPassword][first]' => 'mypassword', | 266 | 'new_user[plainPassword][first]' => 'mypassword', |
267 | 'new_user[plainPassword][second]' => 'mypassword', | 267 | 'new_user[plainPassword][second]' => 'mypassword', |
268 | 'new_user[email]' => '', | 268 | 'new_user[email]' => '', |
269 | ), | 269 | ], |
270 | 'fos_user.username.short', | 270 | 'fos_user.username.short', |
271 | ), | 271 | ], |
272 | array( | 272 | [ |
273 | array( | 273 | [ |
274 | 'new_user[username]' => 'wallace', | 274 | 'new_user[username]' => 'wallace', |
275 | 'new_user[plainPassword][first]' => 'mypassword', | 275 | 'new_user[plainPassword][first]' => 'mypassword', |
276 | 'new_user[plainPassword][second]' => 'mypassword', | 276 | 'new_user[plainPassword][second]' => 'mypassword', |
277 | 'new_user[email]' => 'test', | 277 | 'new_user[email]' => 'test', |
278 | ), | 278 | ], |
279 | 'fos_user.email.invalid', | 279 | 'fos_user.email.invalid', |
280 | ), | 280 | ], |
281 | array( | 281 | [ |
282 | array( | 282 | [ |
283 | 'new_user[username]' => 'admin', | 283 | 'new_user[username]' => 'admin', |
284 | 'new_user[plainPassword][first]' => 'wallacewallace', | 284 | 'new_user[plainPassword][first]' => 'wallacewallace', |
285 | 'new_user[plainPassword][second]' => 'wallacewallace', | 285 | 'new_user[plainPassword][second]' => 'wallacewallace', |
286 | 'new_user[email]' => 'wallace@wallace.me', | 286 | 'new_user[email]' => 'wallace@wallace.me', |
287 | ), | 287 | ], |
288 | 'fos_user.username.already_used', | 288 | 'fos_user.username.already_used', |
289 | ), | 289 | ], |
290 | array( | 290 | [ |
291 | array( | 291 | [ |
292 | 'new_user[username]' => 'wallace', | 292 | 'new_user[username]' => 'wallace', |
293 | 'new_user[plainPassword][first]' => 'mypassword1', | 293 | 'new_user[plainPassword][first]' => 'mypassword1', |
294 | 'new_user[plainPassword][second]' => 'mypassword2', | 294 | 'new_user[plainPassword][second]' => 'mypassword2', |
295 | 'new_user[email]' => 'wallace@wallace.me', | 295 | 'new_user[email]' => 'wallace@wallace.me', |
296 | ), | 296 | ], |
297 | 'validator.password_must_match', | 297 | 'validator.password_must_match', |
298 | ), | 298 | ], |
299 | ); | 299 | ]; |
300 | } | 300 | } |
301 | 301 | ||
302 | /** | 302 | /** |
@@ -317,7 +317,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
317 | 317 | ||
318 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 318 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
319 | 319 | ||
320 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 320 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
321 | $this->assertContains($expectedMessage, $alert[0]); | 321 | $this->assertContains($expectedMessage, $alert[0]); |
322 | } | 322 | } |
323 | 323 | ||
@@ -332,12 +332,12 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
332 | 332 | ||
333 | $form = $crawler->filter('button[id=new_user_save]')->form(); | 333 | $form = $crawler->filter('button[id=new_user_save]')->form(); |
334 | 334 | ||
335 | $data = array( | 335 | $data = [ |
336 | 'new_user[username]' => 'wallace', | 336 | 'new_user[username]' => 'wallace', |
337 | 'new_user[plainPassword][first]' => 'wallace1', | 337 | 'new_user[plainPassword][first]' => 'wallace1', |
338 | 'new_user[plainPassword][second]' => 'wallace1', | 338 | 'new_user[plainPassword][second]' => 'wallace1', |
339 | 'new_user[email]' => 'wallace@wallace.me', | 339 | 'new_user[email]' => 'wallace@wallace.me', |
340 | ); | 340 | ]; |
341 | 341 | ||
342 | $client->submit($form, $data); | 342 | $client->submit($form, $data); |
343 | 343 | ||
@@ -345,7 +345,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
345 | 345 | ||
346 | $crawler = $client->followRedirect(); | 346 | $crawler = $client->followRedirect(); |
347 | 347 | ||
348 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 348 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
349 | $this->assertContains('flashes.config.notice.user_added', $alert[0]); | 349 | $this->assertContains('flashes.config.notice.user_added', $alert[0]); |
350 | 350 | ||
351 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); | 351 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); |
@@ -381,7 +381,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
381 | 381 | ||
382 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 382 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
383 | 383 | ||
384 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 384 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
385 | $this->assertContains('config.form_rss.no_token', $body[0]); | 385 | $this->assertContains('config.form_rss.no_token', $body[0]); |
386 | 386 | ||
387 | $client->request('GET', '/generate-token'); | 387 | $client->request('GET', '/generate-token'); |
@@ -389,7 +389,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
389 | 389 | ||
390 | $crawler = $client->followRedirect(); | 390 | $crawler = $client->followRedirect(); |
391 | 391 | ||
392 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 392 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
393 | $this->assertNotContains('config.form_rss.no_token', $body[0]); | 393 | $this->assertNotContains('config.form_rss.no_token', $body[0]); |
394 | } | 394 | } |
395 | 395 | ||
@@ -401,9 +401,9 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
401 | $client->request( | 401 | $client->request( |
402 | 'GET', | 402 | 'GET', |
403 | '/generate-token', | 403 | '/generate-token', |
404 | array(), | 404 | [], |
405 | array(), | 405 | [], |
406 | array('HTTP_X-Requested-With' => 'XMLHttpRequest') | 406 | ['HTTP_X-Requested-With' => 'XMLHttpRequest'] |
407 | ); | 407 | ); |
408 | 408 | ||
409 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 409 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
@@ -422,9 +422,9 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
422 | 422 | ||
423 | $form = $crawler->filter('button[id=rss_config_save]')->form(); | 423 | $form = $crawler->filter('button[id=rss_config_save]')->form(); |
424 | 424 | ||
425 | $data = array( | 425 | $data = [ |
426 | 'rss_config[rss_limit]' => 12, | 426 | 'rss_config[rss_limit]' => 12, |
427 | ); | 427 | ]; |
428 | 428 | ||
429 | $client->submit($form, $data); | 429 | $client->submit($form, $data); |
430 | 430 | ||
@@ -432,26 +432,26 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
432 | 432 | ||
433 | $crawler = $client->followRedirect(); | 433 | $crawler = $client->followRedirect(); |
434 | 434 | ||
435 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 435 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
436 | $this->assertContains('flashes.config.notice.rss_updated', $alert[0]); | 436 | $this->assertContains('flashes.config.notice.rss_updated', $alert[0]); |
437 | } | 437 | } |
438 | 438 | ||
439 | public function dataForRssFailed() | 439 | public function dataForRssFailed() |
440 | { | 440 | { |
441 | return array( | 441 | return [ |
442 | array( | 442 | [ |
443 | array( | 443 | [ |
444 | 'rss_config[rss_limit]' => 0, | 444 | 'rss_config[rss_limit]' => 0, |
445 | ), | 445 | ], |
446 | 'This value should be 1 or more.', | 446 | 'This value should be 1 or more.', |
447 | ), | 447 | ], |
448 | array( | 448 | [ |
449 | array( | 449 | [ |
450 | 'rss_config[rss_limit]' => 1000000000000, | 450 | 'rss_config[rss_limit]' => 1000000000000, |
451 | ), | 451 | ], |
452 | 'validator.rss_limit_too_hight', | 452 | 'validator.rss_limit_too_hight', |
453 | ), | 453 | ], |
454 | ); | 454 | ]; |
455 | } | 455 | } |
456 | 456 | ||
457 | /** | 457 | /** |
@@ -472,7 +472,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
472 | 472 | ||
473 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 473 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
474 | 474 | ||
475 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text'))); | 475 | $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); |
476 | $this->assertContains($expectedMessage, $alert[0]); | 476 | $this->assertContains($expectedMessage, $alert[0]); |
477 | } | 477 | } |
478 | 478 | ||
@@ -487,10 +487,10 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
487 | 487 | ||
488 | $form = $crawler->filter('button[id=tagging_rule_save]')->form(); | 488 | $form = $crawler->filter('button[id=tagging_rule_save]')->form(); |
489 | 489 | ||
490 | $data = array( | 490 | $data = [ |
491 | 'tagging_rule[rule]' => 'readingTime <= 3', | 491 | 'tagging_rule[rule]' => 'readingTime <= 3', |
492 | 'tagging_rule[tags]' => 'short reading', | 492 | 'tagging_rule[tags]' => 'short reading', |
493 | ); | 493 | ]; |
494 | 494 | ||
495 | $client->submit($form, $data); | 495 | $client->submit($form, $data); |
496 | 496 | ||
@@ -498,7 +498,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
498 | 498 | ||
499 | $crawler = $client->followRedirect(); | 499 | $crawler = $client->followRedirect(); |
500 | 500 | ||
501 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 501 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
502 | $this->assertContains('flashes.config.notice.tagging_rules_updated', $alert[0]); | 502 | $this->assertContains('flashes.config.notice.tagging_rules_updated', $alert[0]); |
503 | 503 | ||
504 | $deleteLink = $crawler->filter('.delete')->last()->link(); | 504 | $deleteLink = $crawler->filter('.delete')->last()->link(); |
@@ -507,34 +507,34 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
507 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 507 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
508 | 508 | ||
509 | $crawler = $client->followRedirect(); | 509 | $crawler = $client->followRedirect(); |
510 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 510 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); |
511 | $this->assertContains('flashes.config.notice.tagging_rules_deleted', $alert[0]); | 511 | $this->assertContains('flashes.config.notice.tagging_rules_deleted', $alert[0]); |
512 | } | 512 | } |
513 | 513 | ||
514 | public function dataForTaggingRuleFailed() | 514 | public function dataForTaggingRuleFailed() |
515 | { | 515 | { |
516 | return array( | 516 | return [ |
517 | array( | 517 | [ |
518 | array( | 518 | [ |
519 | 'tagging_rule[rule]' => 'unknownVar <= 3', | 519 | 'tagging_rule[rule]' => 'unknownVar <= 3', |
520 | 'tagging_rule[tags]' => 'cool tag', | 520 | 'tagging_rule[tags]' => 'cool tag', |
521 | ), | 521 | ], |
522 | array( | 522 | [ |
523 | 'The variable', | 523 | 'The variable', |
524 | 'does not exist.', | 524 | 'does not exist.', |
525 | ), | 525 | ], |
526 | ), | 526 | ], |
527 | array( | 527 | [ |
528 | array( | 528 | [ |
529 | 'tagging_rule[rule]' => 'length(domainName) <= 42', | 529 | 'tagging_rule[rule]' => 'length(domainName) <= 42', |
530 | 'tagging_rule[tags]' => 'cool tag', | 530 | 'tagging_rule[tags]' => 'cool tag', |
531 | ), | 531 | ], |
532 | array( | 532 | [ |
533 | 'The operator', | 533 | 'The operator', |
534 | 'does not exist.', | 534 | 'does not exist.', |
535 | ), | 535 | ], |
536 | ), | 536 | ], |
537 | ); | 537 | ]; |
538 | } | 538 | } |
539 | 539 | ||
540 | /** | 540 | /** |
@@ -555,7 +555,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
555 | 555 | ||
556 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 556 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
557 | 557 | ||
558 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 558 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
559 | 559 | ||
560 | foreach ($messages as $message) { | 560 | foreach ($messages as $message) { |
561 | $this->assertContains($message, $body[0]); | 561 | $this->assertContains($message, $body[0]); |
@@ -574,7 +574,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
574 | $crawler = $client->request('GET', '/tagging-rule/delete/'.$rule->getId()); | 574 | $crawler = $client->request('GET', '/tagging-rule/delete/'.$rule->getId()); |
575 | 575 | ||
576 | $this->assertEquals(403, $client->getResponse()->getStatusCode()); | 576 | $this->assertEquals(403, $client->getResponse()->getStatusCode()); |
577 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 577 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
578 | $this->assertContains('You can not access this tagging rule', $body[0]); | 578 | $this->assertContains('You can not access this tagging rule', $body[0]); |
579 | } | 579 | } |
580 | 580 | ||
@@ -593,11 +593,11 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
593 | 593 | ||
594 | $form = $crawler->filter('button[id=change_passwd_save]')->form(); | 594 | $form = $crawler->filter('button[id=change_passwd_save]')->form(); |
595 | 595 | ||
596 | $data = array( | 596 | $data = [ |
597 | 'change_passwd[old_password]' => 'mypassword', | 597 | 'change_passwd[old_password]' => 'mypassword', |
598 | 'change_passwd[new_password][first]' => 'mypassword', | 598 | 'change_passwd[new_password][first]' => 'mypassword', |
599 | 'change_passwd[new_password][second]' => 'mypassword', | 599 | 'change_passwd[new_password][second]' => 'mypassword', |
600 | ); | 600 | ]; |
601 | 601 | ||
602 | $client->submit($form, $data); | 602 | $client->submit($form, $data); |
603 | 603 | ||
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index a3527898..64ebd631 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php | |||
@@ -28,7 +28,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
28 | $crawler = $client->followRedirect(); | 28 | $crawler = $client->followRedirect(); |
29 | 29 | ||
30 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 30 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
31 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 31 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
32 | $this->assertContains('quickstart.intro.paragraph_1', $body[0]); | 32 | $this->assertContains('quickstart.intro.paragraph_1', $body[0]); |
33 | 33 | ||
34 | // Test if quickstart is disabled when user has 1 entry | 34 | // Test if quickstart is disabled when user has 1 entry |
@@ -38,16 +38,16 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
38 | 38 | ||
39 | $form = $crawler->filter('form[name=entry]')->form(); | 39 | $form = $crawler->filter('form[name=entry]')->form(); |
40 | 40 | ||
41 | $data = array( | 41 | $data = [ |
42 | 'entry[url]' => $this->url, | 42 | 'entry[url]' => $this->url, |
43 | ); | 43 | ]; |
44 | 44 | ||
45 | $client->submit($form, $data); | 45 | $client->submit($form, $data); |
46 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 46 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
47 | $client->followRedirect(); | 47 | $client->followRedirect(); |
48 | 48 | ||
49 | $crawler = $client->request('GET', '/unread/list'); | 49 | $crawler = $client->request('GET', '/unread/list'); |
50 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 50 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
51 | $this->assertContains('entry.list.number_on_the_page', $body[0]); | 51 | $this->assertContains('entry.list.number_on_the_page', $body[0]); |
52 | } | 52 | } |
53 | 53 | ||
@@ -74,7 +74,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
74 | $this->assertCount(4, $crawler->filter('div[class=entry]')); | 74 | $this->assertCount(4, $crawler->filter('div[class=entry]')); |
75 | 75 | ||
76 | // Good URL | 76 | // Good URL |
77 | $client->request('GET', '/bookmarklet', array('url' => $this->url)); | 77 | $client->request('GET', '/bookmarklet', ['url' => $this->url]); |
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
79 | $client->followRedirect(); | 79 | $client->followRedirect(); |
80 | $crawler = $client->request('GET', '/'); | 80 | $crawler = $client->request('GET', '/'); |
@@ -103,7 +103,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
103 | $crawler = $client->submit($form); | 103 | $crawler = $client->submit($form); |
104 | 104 | ||
105 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 105 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
106 | $this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(array('_text'))); | 106 | $this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(['_text'])); |
107 | $this->assertEquals('This value should not be blank.', $alert[0]); | 107 | $this->assertEquals('This value should not be blank.', $alert[0]); |
108 | } | 108 | } |
109 | 109 | ||
@@ -121,9 +121,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
121 | 121 | ||
122 | $form = $crawler->filter('form[name=entry]')->form(); | 122 | $form = $crawler->filter('form[name=entry]')->form(); |
123 | 123 | ||
124 | $data = array( | 124 | $data = [ |
125 | 'entry[url]' => $this->url, | 125 | 'entry[url]' => $this->url, |
126 | ); | 126 | ]; |
127 | 127 | ||
128 | $client->submit($form, $data); | 128 | $client->submit($form, $data); |
129 | 129 | ||
@@ -150,9 +150,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
150 | 150 | ||
151 | $form = $crawler->filter('form[name=entry]')->form(); | 151 | $form = $crawler->filter('form[name=entry]')->form(); |
152 | 152 | ||
153 | $data = array( | 153 | $data = [ |
154 | 'entry[url]' => $this->url, | 154 | 'entry[url]' => $this->url, |
155 | ); | 155 | ]; |
156 | 156 | ||
157 | $client->submit($form, $data); | 157 | $client->submit($form, $data); |
158 | 158 | ||
@@ -174,9 +174,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
174 | 174 | ||
175 | $form = $crawler->filter('form[name=entry]')->form(); | 175 | $form = $crawler->filter('form[name=entry]')->form(); |
176 | 176 | ||
177 | $data = array( | 177 | $data = [ |
178 | 'entry[url]' => $url = 'https://github.com/wallabag/wallabag', | 178 | 'entry[url]' => $url = 'https://github.com/wallabag/wallabag', |
179 | ); | 179 | ]; |
180 | 180 | ||
181 | $client->submit($form, $data); | 181 | $client->submit($form, $data); |
182 | 182 | ||
@@ -245,7 +245,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
245 | $crawler = $client->request('GET', '/view/'.$content->getId()); | 245 | $crawler = $client->request('GET', '/view/'.$content->getId()); |
246 | 246 | ||
247 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 247 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
248 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | 248 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
249 | $this->assertContains($content->getTitle(), $body[0]); | 249 | $this->assertContains($content->getTitle(), $body[0]); |
250 | } | 250 | } |
251 | 251 | ||
@@ -315,9 +315,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
315 | 315 | ||
316 | $form = $crawler->filter('button[type=submit]')->form(); | 316 | $form = $crawler->filter('button[type=submit]')->form(); |
317 | 317 | ||
318 | $data = array( | 318 | $data = [ |
319 | 'entry[title]' => 'My updated title hehe :)', | 319 | 'entry[title]' => 'My updated title hehe :)', |
320 | ); | 320 | ]; |
321 | 321 | ||
322 | $client->submit($form, $data); | 322 | $client->submit($form, $data); |
323 | 323 | ||
@@ -325,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
325 | 325 | ||
326 | $crawler = $client->followRedirect(); | 326 | $crawler = $client->followRedirect(); |
327 | 327 | ||
328 | $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(array('_text'))); | 328 | $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(['_text'])); |
329 | $this->assertContains('My updated title hehe :)', $alert[0]); | 329 | $this->assertContains('My updated title hehe :)', $alert[0]); |
330 | } | 330 | } |
331 | 331 | ||
@@ -461,10 +461,10 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
461 | 461 | ||
462 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 462 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
463 | 463 | ||
464 | $data = array( | 464 | $data = [ |
465 | 'entry_filter[readingTime][right_number]' => 11, | 465 | 'entry_filter[readingTime][right_number]' => 11, |
466 | 'entry_filter[readingTime][left_number]' => 11, | 466 | 'entry_filter[readingTime][left_number]' => 11, |
467 | ); | 467 | ]; |
468 | 468 | ||
469 | $crawler = $client->submit($form, $data); | 469 | $crawler = $client->submit($form, $data); |
470 | 470 | ||
@@ -480,28 +480,28 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
480 | 480 | ||
481 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 481 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
482 | 482 | ||
483 | $data = array( | 483 | $data = [ |
484 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), | 484 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), |
485 | 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')), | 485 | 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')), |
486 | ); | 486 | ]; |
487 | 487 | ||
488 | $crawler = $client->submit($form, $data); | 488 | $crawler = $client->submit($form, $data); |
489 | 489 | ||
490 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | 490 | $this->assertCount(5, $crawler->filter('div[class=entry]')); |
491 | 491 | ||
492 | $data = array( | 492 | $data = [ |
493 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), | 493 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), |
494 | 'entry_filter[createdAt][right_date]' => date('d/m/Y'), | 494 | 'entry_filter[createdAt][right_date]' => date('d/m/Y'), |
495 | ); | 495 | ]; |
496 | 496 | ||
497 | $crawler = $client->submit($form, $data); | 497 | $crawler = $client->submit($form, $data); |
498 | 498 | ||
499 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | 499 | $this->assertCount(5, $crawler->filter('div[class=entry]')); |
500 | 500 | ||
501 | $data = array( | 501 | $data = [ |
502 | 'entry_filter[createdAt][left_date]' => '01/01/1970', | 502 | 'entry_filter[createdAt][left_date]' => '01/01/1970', |
503 | 'entry_filter[createdAt][right_date]' => '01/01/1970', | 503 | 'entry_filter[createdAt][right_date]' => '01/01/1970', |
504 | ); | 504 | ]; |
505 | 505 | ||
506 | $crawler = $client->submit($form, $data); | 506 | $crawler = $client->submit($form, $data); |
507 | 507 | ||
@@ -516,9 +516,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
516 | 516 | ||
517 | $form = $crawler->filter('button[id=config_save]')->form(); | 517 | $form = $crawler->filter('button[id=config_save]')->form(); |
518 | 518 | ||
519 | $data = array( | 519 | $data = [ |
520 | 'config[items_per_page]' => '1', | 520 | 'config[items_per_page]' => '1', |
521 | ); | 521 | ]; |
522 | 522 | ||
523 | $client->submit($form, $data); | 523 | $client->submit($form, $data); |
524 | 524 | ||
@@ -531,9 +531,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
531 | // reset pagination | 531 | // reset pagination |
532 | $crawler = $client->request('GET', '/config'); | 532 | $crawler = $client->request('GET', '/config'); |
533 | $form = $crawler->filter('button[id=config_save]')->form(); | 533 | $form = $crawler->filter('button[id=config_save]')->form(); |
534 | $data = array( | 534 | $data = [ |
535 | 'config[items_per_page]' => '12', | 535 | 'config[items_per_page]' => '12', |
536 | ); | 536 | ]; |
537 | $client->submit($form, $data); | 537 | $client->submit($form, $data); |
538 | } | 538 | } |
539 | 539 | ||
@@ -544,17 +544,17 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
544 | 544 | ||
545 | $crawler = $client->request('GET', '/unread/list'); | 545 | $crawler = $client->request('GET', '/unread/list'); |
546 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 546 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
547 | $data = array( | 547 | $data = [ |
548 | 'entry_filter[domainName]' => 'domain', | 548 | 'entry_filter[domainName]' => 'domain', |
549 | ); | 549 | ]; |
550 | 550 | ||
551 | $crawler = $client->submit($form, $data); | 551 | $crawler = $client->submit($form, $data); |
552 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | 552 | $this->assertCount(5, $crawler->filter('div[class=entry]')); |
553 | 553 | ||
554 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 554 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
555 | $data = array( | 555 | $data = [ |
556 | 'entry_filter[domainName]' => 'wallabag', | 556 | 'entry_filter[domainName]' => 'wallabag', |
557 | ); | 557 | ]; |
558 | 558 | ||
559 | $crawler = $client->submit($form, $data); | 559 | $crawler = $client->submit($form, $data); |
560 | $this->assertCount(0, $crawler->filter('div[class=entry]')); | 560 | $this->assertCount(0, $crawler->filter('div[class=entry]')); |
@@ -601,17 +601,17 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
601 | 601 | ||
602 | $crawler = $client->request('GET', '/unread/list'); | 602 | $crawler = $client->request('GET', '/unread/list'); |
603 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 603 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
604 | $data = array( | 604 | $data = [ |
605 | 'entry_filter[language]' => 'fr', | 605 | 'entry_filter[language]' => 'fr', |
606 | ); | 606 | ]; |
607 | 607 | ||
608 | $crawler = $client->submit($form, $data); | 608 | $crawler = $client->submit($form, $data); |
609 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | 609 | $this->assertCount(2, $crawler->filter('div[class=entry]')); |
610 | 610 | ||
611 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 611 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
612 | $data = array( | 612 | $data = [ |
613 | 'entry_filter[language]' => 'en', | 613 | 'entry_filter[language]' => 'en', |
614 | ); | 614 | ]; |
615 | 615 | ||
616 | $crawler = $client->submit($form, $data); | 616 | $crawler = $client->submit($form, $data); |
617 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | 617 | $this->assertCount(2, $crawler->filter('div[class=entry]')); |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/RssControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/RssControllerTest.php index 45a74c43..87a01b8e 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/RssControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/RssControllerTest.php | |||
@@ -34,17 +34,17 @@ class RssControllerTest extends WallabagCoreTestCase | |||
34 | 34 | ||
35 | public function dataForBadUrl() | 35 | public function dataForBadUrl() |
36 | { | 36 | { |
37 | return array( | 37 | return [ |
38 | array( | 38 | [ |
39 | '/admin/YZIOAUZIAO/unread.xml', | 39 | '/admin/YZIOAUZIAO/unread.xml', |
40 | ), | 40 | ], |
41 | array( | 41 | [ |
42 | '/wallace/YZIOAUZIAO/starred.xml', | 42 | '/wallace/YZIOAUZIAO/starred.xml', |
43 | ), | 43 | ], |
44 | array( | 44 | [ |
45 | '/wallace/YZIOAUZIAO/archives.xml', | 45 | '/wallace/YZIOAUZIAO/archives.xml', |
46 | ), | 46 | ], |
47 | ); | 47 | ]; |
48 | } | 48 | } |
49 | 49 | ||
50 | /** | 50 | /** |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php index ed292633..2910fa4f 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php | |||
@@ -13,7 +13,7 @@ class SecurityControllerTest extends WallabagCoreTestCase | |||
13 | $client->followRedirects(); | 13 | $client->followRedirects(); |
14 | 14 | ||
15 | $crawler = $client->request('GET', '/config'); | 15 | $crawler = $client->request('GET', '/config'); |
16 | $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(array('_text'))[0]); | 16 | $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(['_text'])[0]); |
17 | } | 17 | } |
18 | 18 | ||
19 | public function testLoginWith2Factor() | 19 | public function testLoginWith2Factor() |
@@ -38,7 +38,7 @@ class SecurityControllerTest extends WallabagCoreTestCase | |||
38 | 38 | ||
39 | $this->logInAs('admin'); | 39 | $this->logInAs('admin'); |
40 | $crawler = $client->request('GET', '/config'); | 40 | $crawler = $client->request('GET', '/config'); |
41 | $this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(array('_text'))[0]); | 41 | $this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(['_text'])[0]); |
42 | 42 | ||
43 | // restore user | 43 | // restore user |
44 | $user = $em | 44 | $user = $em |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php index 1457c807..8af37ea4 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | |||
@@ -32,9 +32,9 @@ class TagControllerTest extends WallabagCoreTestCase | |||
32 | 32 | ||
33 | $form = $crawler->filter('form[name=tag]')->form(); | 33 | $form = $crawler->filter('form[name=tag]')->form(); |
34 | 34 | ||
35 | $data = array( | 35 | $data = [ |
36 | 'tag[label]' => $this->tagName, | 36 | 'tag[label]' => $this->tagName, |
37 | ); | 37 | ]; |
38 | 38 | ||
39 | $client->submit($form, $data); | 39 | $client->submit($form, $data); |
40 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 40 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
@@ -53,9 +53,9 @@ class TagControllerTest extends WallabagCoreTestCase | |||
53 | $this->assertEquals(1, count($newEntry->getTags())); | 53 | $this->assertEquals(1, count($newEntry->getTags())); |
54 | 54 | ||
55 | # tag already exists but still not assigned to this entry | 55 | # tag already exists but still not assigned to this entry |
56 | $data = array( | 56 | $data = [ |
57 | 'tag[label]' => 'foo', | 57 | 'tag[label]' => 'foo', |
58 | ); | 58 | ]; |
59 | 59 | ||
60 | $client->submit($form, $data); | 60 | $client->submit($form, $data); |
61 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 61 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
@@ -82,9 +82,9 @@ class TagControllerTest extends WallabagCoreTestCase | |||
82 | 82 | ||
83 | $form = $crawler->filter('form[name=tag]')->form(); | 83 | $form = $crawler->filter('form[name=tag]')->form(); |
84 | 84 | ||
85 | $data = array( | 85 | $data = [ |
86 | 'tag[label]' => 'foo2, bar2', | 86 | 'tag[label]' => 'foo2, bar2', |
87 | ); | 87 | ]; |
88 | 88 | ||
89 | $client->submit($form, $data); | 89 | $client->submit($form, $data); |
90 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 90 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |