aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 29d15eea..3dcc1cd0 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -822,13 +822,25 @@ class EntryControllerTest extends WallabagCoreTestCase
822 $this->logInAs('admin'); 822 $this->logInAs('admin');
823 $client = $this->getClient(); 823 $client = $this->getClient();
824 824
825 $em = $this->getEntityManager();
826
827 $today = new \DateTimeImmutable();
828 $tomorrow = $today->add(new \DateInterval('P1D'));
829 $yesterday = $today->sub(new \DateInterval('P1D'));
830
831 $entry = new Entry($this->getLoggedInUser());
832 $entry->setUrl('http://0.0.0.0/testFilterOnCreationDate');
833 $entry->setCreatedAt($yesterday);
834 $em->persist($entry);
835 $em->flush();
836
825 $crawler = $client->request('GET', '/unread/list'); 837 $crawler = $client->request('GET', '/unread/list');
826 838
827 $form = $crawler->filter('button[id=submit-filter]')->form(); 839 $form = $crawler->filter('button[id=submit-filter]')->form();
828 840
829 $data = [ 841 $data = [
830 'entry_filter[createdAt][left_date]' => date('d/m/Y'), 842 'entry_filter[createdAt][left_date]' => $today->format('Y-m-d'),
831 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')), 843 'entry_filter[createdAt][right_date]' => $tomorrow->format('Y-m-d'),
832 ]; 844 ];
833 845
834 $crawler = $client->submit($form, $data); 846 $crawler = $client->submit($form, $data);
@@ -836,8 +848,8 @@ class EntryControllerTest extends WallabagCoreTestCase
836 $this->assertCount(5, $crawler->filter('li.entry')); 848 $this->assertCount(5, $crawler->filter('li.entry'));
837 849
838 $data = [ 850 $data = [
839 'entry_filter[createdAt][left_date]' => date('d/m/Y'), 851 'entry_filter[createdAt][left_date]' => $today->format('Y-m-d'),
840 'entry_filter[createdAt][right_date]' => date('d/m/Y'), 852 'entry_filter[createdAt][right_date]' => $today->format('Y-m-d'),
841 ]; 853 ];
842 854
843 $crawler = $client->submit($form, $data); 855 $crawler = $client->submit($form, $data);
@@ -845,8 +857,8 @@ class EntryControllerTest extends WallabagCoreTestCase
845 $this->assertCount(5, $crawler->filter('li.entry')); 857 $this->assertCount(5, $crawler->filter('li.entry'));
846 858
847 $data = [ 859 $data = [
848 'entry_filter[createdAt][left_date]' => '01/01/1970', 860 'entry_filter[createdAt][left_date]' => '1970-01-01',
849 'entry_filter[createdAt][right_date]' => '01/01/1970', 861 'entry_filter[createdAt][right_date]' => '1970-01-01',
850 ]; 862 ];
851 863
852 $crawler = $client->submit($form, $data); 864 $crawler = $client->submit($form, $data);