aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-03-08 17:02:34 +0100
committerThomas Citharel <tcit@tcit.fr>2016-06-09 17:12:51 +0200
commit5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3 (patch)
tree03ee1eab0d89d1857daca9e273fd8c9ca47e33c2 /src/Wallabag/CoreBundle/Tests/Controller
parent9f95b14dec88cf083cefa38d5fbd84189e07acac (diff)
downloadwallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.tar.gz
wallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.tar.zst
wallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.zip
manage assets through npm
first draft remote assetic totally work nearly there use at least nodejs > 0.12 use proper version of grunt bump nodejs version for travis update npm workaround for materialize install node 5.0 add grunt-cli baggy theme & cache node modules cache bower & npm make travis build assets on php7 only exclude installing node & npm if not needed & use bash clean & try to make icomoon work on baggy ready config for travis rebase make travis work more travis work impove travis & update deps add missing pixrem deps add module through oddly lost ui updates install latest nodejs add install_dev.sh, link local binaries for npm/bower/grunt ui improvements (mostly baggy) fix travis build no need to install on travis Add unread filter to entries pages Add the ability to filter for unread pages in the filters menu. Add unread filter test to EntryControllerTest Add a new test to the EntryControllerTest collection which checks that only entries which have not been archived (and are treated as "unread") are retrieved. Improve English translation Update FAQ -Fix grammar -Add notes about MTA, firewall, and SELinux Update installation instructions -Fix grammar -Add SELinux section add screenshots of android docu in English Fix the deletion of Tags/Entries relation when delete an entry Fix #2121 Move fixtures to the right place Display a message when saving an entry failed When saving an entry fail because of database error we previously just returned `false`. Now we got an error in the log and the displayed notice to the user is updated too. Change ManyToMany between entry & tag Following https://gist.github.com/Ocramius/3121916 Be sure to remove the related entity when removing an entity. Let say you have Entry -> EntryTag -> Tag. If you remove the entry: - before that commit, the EntryTag will stay (at least using SQLite). - with that commit, the related entity is removed Prepare wallabag 2.0.5 enforce older materialize version
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php52
1 files changed, 49 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index df4c34cd..5ce893c1 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -163,7 +163,7 @@ class EntryControllerTest extends WallabagCoreTestCase
163 /** 163 /**
164 * This test will require an internet connection. 164 * This test will require an internet connection.
165 */ 165 */
166 public function testPostNewThatWillBeTaggued() 166 public function testPostNewThatWillBeTagged()
167 { 167 {
168 $this->logInAs('admin'); 168 $this->logInAs('admin');
169 $client = $this->getClient(); 169 $client = $this->getClient();
@@ -181,8 +181,7 @@ class EntryControllerTest extends WallabagCoreTestCase
181 $client->submit($form, $data); 181 $client->submit($form, $data);
182 182
183 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 183 $this->assertEquals(302, $client->getResponse()->getStatusCode());
184 184 $this->assertContains('/', $client->getResponse()->getTargetUrl());
185 $client->followRedirect();
186 185
187 $em = $client->getContainer() 186 $em = $client->getContainer()
188 ->get('doctrine.orm.entity_manager'); 187 ->get('doctrine.orm.entity_manager');
@@ -196,6 +195,35 @@ class EntryControllerTest extends WallabagCoreTestCase
196 195
197 $em->remove($entry); 196 $em->remove($entry);
198 $em->flush(); 197 $em->flush();
198
199 // and now re-submit it to test the cascade persistence for tags after entry removal
200 // related https://github.com/wallabag/wallabag/issues/2121
201 $crawler = $client->request('GET', '/new');
202
203 $this->assertEquals(200, $client->getResponse()->getStatusCode());
204
205 $form = $crawler->filter('form[name=entry]')->form();
206
207 $data = [
208 'entry[url]' => $url = 'https://github.com/wallabag/wallabag/tree/master',
209 ];
210
211 $client->submit($form, $data);
212
213 $this->assertEquals(302, $client->getResponse()->getStatusCode());
214 $this->assertContains('/', $client->getResponse()->getTargetUrl());
215
216 $entry = $em
217 ->getRepository('WallabagCoreBundle:Entry')
218 ->findOneByUrl($url);
219
220 $tags = $entry->getTags();
221
222 $this->assertCount(1, $tags);
223 $this->assertEquals('wallabag', $tags[0]->getLabel());
224
225 $em->remove($entry);
226 $em->flush();
199 } 227 }
200 228
201 public function testArchive() 229 public function testArchive()
@@ -471,6 +499,24 @@ class EntryControllerTest extends WallabagCoreTestCase
471 $this->assertCount(1, $crawler->filter('div[class=entry]')); 499 $this->assertCount(1, $crawler->filter('div[class=entry]'));
472 } 500 }
473 501
502 public function testFilterOnUnreadStatus()
503 {
504 $this->logInAs('admin');
505 $client = $this->getClient();
506
507 $crawler = $client->request('GET', '/all/list');
508
509 $form = $crawler->filter('button[id=submit-filter]')->form();
510
511 $data = [
512 'entry_filter[isUnread]' => true,
513 ];
514
515 $crawler = $client->submit($form, $data);
516
517 $this->assertCount(4, $crawler->filter('div[class=entry]'));
518 }
519
474 public function testFilterOnCreationDate() 520 public function testFilterOnCreationDate()
475 { 521 {
476 $this->logInAs('admin'); 522 $this->logInAs('admin');