aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 0bd18c44..87c16415 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -241,7 +241,7 @@ class EntryControllerTest extends WallabagCoreTestCase
241 $this->assertEquals(403, $client->getResponse()->getStatusCode()); 241 $this->assertEquals(403, $client->getResponse()->getStatusCode());
242 } 242 }
243 243
244 public function testFilterOnUnreadeView() 244 public function testFilterOnReadingTime()
245 { 245 {
246 $this->logInAs('admin'); 246 $this->logInAs('admin');
247 $client = $this->getClient(); 247 $client = $this->getClient();
@@ -260,6 +260,35 @@ class EntryControllerTest extends WallabagCoreTestCase
260 $this->assertCount(1, $crawler->filter('div[class=entry]')); 260 $this->assertCount(1, $crawler->filter('div[class=entry]'));
261 } 261 }
262 262
263 public function testFilterOnCreationDate()
264 {
265 $this->logInAs('admin');
266 $client = $this->getClient();
267
268 $crawler = $client->request('GET', '/unread/list');
269
270 $form = $crawler->filter('button[id=submit-filter]')->form();
271
272 $data = array(
273 'entry_filter[createdAt][left_date]' => date('d/m/Y'),
274 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime("+1 day"))
275 );
276
277 $crawler = $client->submit($form, $data);
278
279 $this->assertCount(4, $crawler->filter('div[class=entry]'));
280
281 $data = array(
282 'entry_filter[createdAt][left_date]' => '01/01/1970',
283 'entry_filter[createdAt][right_date]' => '01/01/1970'
284 );
285
286 $crawler = $client->submit($form, $data);
287
288 $this->assertCount(0, $crawler->filter('div[class=entry]'));
289
290 }
291
263 public function testPaginationWithFilter() 292 public function testPaginationWithFilter()
264 { 293 {
265 $this->logInAs('admin'); 294 $this->logInAs('admin');