From ef81e3c89b00712476b0698e7c9057fc05a2e1c9 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 21 Mar 2020 21:09:57 +0100 Subject: tests: replace baggy theme used in EntryController tests Signed-off-by: Kevin Decherf --- .../CoreBundle/Controller/EntryControllerTest.php | 77 +++++++++------------- 1 file changed, 32 insertions(+), 45 deletions(-) (limited to 'tests/Wallabag/CoreBundle/Controller') diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 3a8f92e7..29d15eea 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -90,19 +90,18 @@ class EntryControllerTest extends WallabagCoreTestCase public function testPostNewViaBookmarklet() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/'); - $this->assertCount(4, $crawler->filter('div[class=entry]')); + $this->assertCount(4, $crawler->filter('li.entry')); // Good URL $client->request('GET', '/bookmarklet', ['url' => $this->url]); $this->assertSame(302, $client->getResponse()->getStatusCode()); $client->followRedirect(); $crawler = $client->request('GET', '/'); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $em = $client->getContainer() ->get('doctrine.orm.entity_manager'); @@ -694,7 +693,6 @@ class EntryControllerTest extends WallabagCoreTestCase public function testFilterOnReadingTime() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); @@ -713,7 +711,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); } public function testFilterOnReadingTimeWithNegativeValue() @@ -733,17 +731,16 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); // forcing negative value results in no entry displayed - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); } public function testFilterOnReadingTimeOnlyUpper() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/all/list'); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); @@ -752,7 +749,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->getEntityManager()->flush(); $crawler = $client->request('GET', '/all/list'); - $this->assertCount(6, $crawler->filter('div[class=entry]')); + $this->assertCount(6, $crawler->filter('li.entry')); $form = $crawler->filter('button[id=submit-filter]')->form(); @@ -762,13 +759,12 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); } public function testFilterOnReadingTimeOnlyLower() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -781,7 +777,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); @@ -790,13 +786,12 @@ class EntryControllerTest extends WallabagCoreTestCase $this->getEntityManager()->flush(); $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); } public function testFilterOnUnreadStatus() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/all/list'); @@ -809,7 +804,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(4, $crawler->filter('div[class=entry]')); + $this->assertCount(4, $crawler->filter('li.entry')); $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); @@ -819,13 +814,12 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); } public function testFilterOnCreationDate() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -839,7 +833,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $data = [ 'entry_filter[createdAt][left_date]' => date('d/m/Y'), @@ -848,7 +842,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $data = [ 'entry_filter[createdAt][left_date]' => '01/01/1970', @@ -857,7 +851,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); } public function testPaginationWithFilter() @@ -892,7 +886,6 @@ class EntryControllerTest extends WallabagCoreTestCase public function testFilterOnDomainName() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -902,7 +895,7 @@ class EntryControllerTest extends WallabagCoreTestCase ]; $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $crawler = $client->request('GET', '/unread/list'); $form = $crawler->filter('button[id=submit-filter]')->form(); @@ -911,7 +904,7 @@ class EntryControllerTest extends WallabagCoreTestCase ]; $crawler = $client->submit($form, $data); - $this->assertCount(5, $crawler->filter('div[class=entry]')); + $this->assertCount(5, $crawler->filter('li.entry')); $form = $crawler->filter('button[id=submit-filter]')->form(); $data = [ @@ -919,13 +912,12 @@ class EntryControllerTest extends WallabagCoreTestCase ]; $crawler = $client->submit($form, $data); - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); } public function testFilterOnStatus() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -934,20 +926,19 @@ class EntryControllerTest extends WallabagCoreTestCase $form['entry_filter[isStarred]']->untick(); $crawler = $client->submit($form); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); $form = $crawler->filter('button[id=submit-filter]')->form(); $form['entry_filter[isArchived]']->untick(); $form['entry_filter[isStarred]']->tick(); $crawler = $client->submit($form); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); } public function testFilterOnIsPublic() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -955,13 +946,12 @@ class EntryControllerTest extends WallabagCoreTestCase $form['entry_filter[isPublic]']->tick(); $crawler = $client->submit($form); - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); } public function testPreviewPictureFilter() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $crawler = $client->request('GET', '/unread/list'); @@ -969,13 +959,12 @@ class EntryControllerTest extends WallabagCoreTestCase $form['entry_filter[previewPicture]']->tick(); $crawler = $client->submit($form); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); } public function testFilterOnLanguage() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $entry = new Entry($this->getLoggedInUser()); @@ -991,7 +980,7 @@ class EntryControllerTest extends WallabagCoreTestCase ]; $crawler = $client->submit($form, $data); - $this->assertCount(3, $crawler->filter('div[class=entry]')); + $this->assertCount(3, $crawler->filter('li.entry')); $form = $crawler->filter('button[id=submit-filter]')->form(); $data = [ @@ -999,7 +988,7 @@ class EntryControllerTest extends WallabagCoreTestCase ]; $crawler = $client->submit($form, $data); - $this->assertCount(2, $crawler->filter('div[class=entry]')); + $this->assertCount(2, $crawler->filter('li.entry')); } public function testShareEntryPublicly() @@ -1181,7 +1170,6 @@ class EntryControllerTest extends WallabagCoreTestCase public function testFilterOnHttpStatus() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $entry = new Entry($this->getLoggedInUser()); @@ -1200,7 +1188,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); @@ -1223,7 +1211,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(2, $crawler->filter('div[class=entry]')); + $this->assertCount(2, $crawler->filter('li.entry')); $crawler = $client->request('GET', '/all/list'); $form = $crawler->filter('button[id=submit-filter]')->form(); @@ -1234,13 +1222,12 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(8, $crawler->filter('div[class=entry]')); + $this->assertCount(8, $crawler->filter('li.entry')); } public function testSearch() { $this->logInAs('admin'); - $this->useTheme('baggy'); $client = $this->getClient(); $entry = new Entry($this->getLoggedInUser()); @@ -1259,7 +1246,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(4, $crawler->filter('div[class=entry]')); + $this->assertCount(4, $crawler->filter('li.entry')); // Search on starred list $crawler = $client->request('GET', '/starred/list'); @@ -1278,7 +1265,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); $crawler = $client->request('GET', '/archive/list'); @@ -1297,7 +1284,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); $client->request('GET', '/delete/' . $entry->getId()); // test on list of all articles @@ -1310,7 +1297,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(0, $crawler->filter('div[class=entry]')); + $this->assertCount(0, $crawler->filter('li.entry')); // test url search on list of all articles $entry = new Entry($this->getLoggedInUser()); @@ -1329,7 +1316,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); // same as previous test but for case-sensitivity $crawler = $client->request('GET', '/all/list'); @@ -1341,7 +1328,7 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(1, $crawler->filter('li.entry')); } public function dataForLanguage() -- cgit v1.2.3