aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-20 17:59:58 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-21 07:30:48 +0200
commite1779760999f676cb7a74a201bc2a389959702d4 (patch)
treeeded736468a27083aebc725ba9e133fc6c7d7ab2 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent89659c9eae338cd29e5919b5ffde6924189a59ca (diff)
downloadwallabag-e1779760999f676cb7a74a201bc2a389959702d4.tar.gz
wallabag-e1779760999f676cb7a74a201bc2a389959702d4.tar.zst
wallabag-e1779760999f676cb7a74a201bc2a389959702d4.zip
filters: add test for status filter and adapt other tests results
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 86a19f61..5f0a6076 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -276,7 +276,7 @@ class EntryControllerTest extends WallabagCoreTestCase
276 276
277 $crawler = $client->submit($form, $data); 277 $crawler = $client->submit($form, $data);
278 278
279 $this->assertCount(4, $crawler->filter('div[class=entry]')); 279 $this->assertCount(5, $crawler->filter('div[class=entry]'));
280 280
281 $data = array( 281 $data = array(
282 'entry_filter[createdAt][left_date]' => '01/01/1970', 282 'entry_filter[createdAt][left_date]' => '01/01/1970',
@@ -307,6 +307,14 @@ class EntryControllerTest extends WallabagCoreTestCase
307 $crawler = $client->request('GET', 'unread/list'.$parameters); 307 $crawler = $client->request('GET', 'unread/list'.$parameters);
308 308
309 $this->assertContains($parameters, $client->getResponse()->getContent()); 309 $this->assertContains($parameters, $client->getResponse()->getContent());
310
311 // reset pagination
312 $crawler = $client->request('GET', '/config');
313 $form = $crawler->filter('button[id=config_save]')->form();
314 $data = array(
315 'config[items_per_page]' => '12',
316 );
317 $client->submit($form, $data);
310 } 318 }
311 319
312 public function testFilterOnDomainName() 320 public function testFilterOnDomainName()
@@ -331,4 +339,25 @@ class EntryControllerTest extends WallabagCoreTestCase
331 $crawler = $client->submit($form, $data); 339 $crawler = $client->submit($form, $data);
332 $this->assertCount(0, $crawler->filter('div[class=entry]')); 340 $this->assertCount(0, $crawler->filter('div[class=entry]'));
333 } 341 }
342
343 public function testFilterOnStatus()
344 {
345 $this->logInAs('admin');
346 $client = $this->getClient();
347
348 $crawler = $client->request('GET', '/unread/list');
349 $form = $crawler->filter('button[id=submit-filter]')->form();
350 $form['entry_filter[isArchived]']->tick();
351 $form['entry_filter[isStarred]']->untick();
352
353 $crawler = $client->submit($form);
354 $this->assertCount(1, $crawler->filter('div[class=entry]'));
355
356 $form = $crawler->filter('button[id=submit-filter]')->form();
357 $form['entry_filter[isArchived]']->untick();
358 $form['entry_filter[isStarred]']->tick();
359
360 $crawler = $client->submit($form);
361 $this->assertCount(1, $crawler->filter('div[class=entry]'));
362 }
334} 363}