diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 222 |
1 files changed, 111 insertions, 111 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 | ||