aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 11:36:01 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 12:25:29 +0200
commit4094ea47712efbe58624ff74daeb1f77c9b0edcf (patch)
tree3d2c168092d0208e6ba888de969252a54bf0c6c1 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent7eccbda99f16dc39ee01a0c81ab88293e9b268fd (diff)
downloadwallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.gz
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.zst
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.zip
Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 46fbaf91..5260ca53 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]'));