aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-18 16:33:32 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-18 16:33:32 +0200
commit3f357ee2412e8f25df8a2813e2ba8ff20fb02f89 (patch)
tree036e89d3baeb303beedebbe9ca33357b62346438 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent72ea6dd1a78d9fd0d7531916819489fd31eb17d7 (diff)
downloadwallabag-3f357ee2412e8f25df8a2813e2ba8ff20fb02f89.tar.gz
wallabag-3f357ee2412e8f25df8a2813e2ba8ff20fb02f89.tar.zst
wallabag-3f357ee2412e8f25df8a2813e2ba8ff20fb02f89.zip
add test
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-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');