aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php77
2 files changed, 33 insertions, 46 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index 3906e1e0..540381b6 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -39,7 +39,7 @@
39 39
40 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}"> 40 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}">
41 {% for entry in entries %} 41 {% for entry in entries %}
42 <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12"> 42 <li id="entry-{{ entry.id|e }}" class="entry col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
43 {% if listMode == 1 %} 43 {% if listMode == 1 %}
44 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} 44 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %}
45 {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %} 45 {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %}
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
90 public function testPostNewViaBookmarklet() 90 public function testPostNewViaBookmarklet()
91 { 91 {
92 $this->logInAs('admin'); 92 $this->logInAs('admin');
93 $this->useTheme('baggy');
94 $client = $this->getClient(); 93 $client = $this->getClient();
95 94
96 $crawler = $client->request('GET', '/'); 95 $crawler = $client->request('GET', '/');
97 96
98 $this->assertCount(4, $crawler->filter('div[class=entry]')); 97 $this->assertCount(4, $crawler->filter('li.entry'));
99 98
100 // Good URL 99 // Good URL
101 $client->request('GET', '/bookmarklet', ['url' => $this->url]); 100 $client->request('GET', '/bookmarklet', ['url' => $this->url]);
102 $this->assertSame(302, $client->getResponse()->getStatusCode()); 101 $this->assertSame(302, $client->getResponse()->getStatusCode());
103 $client->followRedirect(); 102 $client->followRedirect();
104 $crawler = $client->request('GET', '/'); 103 $crawler = $client->request('GET', '/');
105 $this->assertCount(5, $crawler->filter('div[class=entry]')); 104 $this->assertCount(5, $crawler->filter('li.entry'));
106 105
107 $em = $client->getContainer() 106 $em = $client->getContainer()
108 ->get('doctrine.orm.entity_manager'); 107 ->get('doctrine.orm.entity_manager');
@@ -694,7 +693,6 @@ class EntryControllerTest extends WallabagCoreTestCase
694 public function testFilterOnReadingTime() 693 public function testFilterOnReadingTime()
695 { 694 {
696 $this->logInAs('admin'); 695 $this->logInAs('admin');
697 $this->useTheme('baggy');
698 $client = $this->getClient(); 696 $client = $this->getClient();
699 $entry = new Entry($this->getLoggedInUser()); 697 $entry = new Entry($this->getLoggedInUser());
700 $entry->setUrl($this->url); 698 $entry->setUrl($this->url);
@@ -713,7 +711,7 @@ class EntryControllerTest extends WallabagCoreTestCase
713 711
714 $crawler = $client->submit($form, $data); 712 $crawler = $client->submit($form, $data);
715 713
716 $this->assertCount(1, $crawler->filter('div[class=entry]')); 714 $this->assertCount(1, $crawler->filter('li.entry'));
717 } 715 }
718 716
719 public function testFilterOnReadingTimeWithNegativeValue() 717 public function testFilterOnReadingTimeWithNegativeValue()
@@ -733,17 +731,16 @@ class EntryControllerTest extends WallabagCoreTestCase
733 $crawler = $client->submit($form, $data); 731 $crawler = $client->submit($form, $data);
734 732
735 // forcing negative value results in no entry displayed 733 // forcing negative value results in no entry displayed
736 $this->assertCount(0, $crawler->filter('div[class=entry]')); 734 $this->assertCount(0, $crawler->filter('li.entry'));
737 } 735 }
738 736
739 public function testFilterOnReadingTimeOnlyUpper() 737 public function testFilterOnReadingTimeOnlyUpper()
740 { 738 {
741 $this->logInAs('admin'); 739 $this->logInAs('admin');
742 $this->useTheme('baggy');
743 $client = $this->getClient(); 740 $client = $this->getClient();
744 741
745 $crawler = $client->request('GET', '/all/list'); 742 $crawler = $client->request('GET', '/all/list');
746 $this->assertCount(5, $crawler->filter('div[class=entry]')); 743 $this->assertCount(5, $crawler->filter('li.entry'));
747 744
748 $entry = new Entry($this->getLoggedInUser()); 745 $entry = new Entry($this->getLoggedInUser());
749 $entry->setUrl($this->url); 746 $entry->setUrl($this->url);
@@ -752,7 +749,7 @@ class EntryControllerTest extends WallabagCoreTestCase
752 $this->getEntityManager()->flush(); 749 $this->getEntityManager()->flush();
753 750
754 $crawler = $client->request('GET', '/all/list'); 751 $crawler = $client->request('GET', '/all/list');
755 $this->assertCount(6, $crawler->filter('div[class=entry]')); 752 $this->assertCount(6, $crawler->filter('li.entry'));
756 753
757 $form = $crawler->filter('button[id=submit-filter]')->form(); 754 $form = $crawler->filter('button[id=submit-filter]')->form();
758 755
@@ -762,13 +759,12 @@ class EntryControllerTest extends WallabagCoreTestCase
762 759
763 $crawler = $client->submit($form, $data); 760 $crawler = $client->submit($form, $data);
764 761
765 $this->assertCount(5, $crawler->filter('div[class=entry]')); 762 $this->assertCount(5, $crawler->filter('li.entry'));
766 } 763 }
767 764
768 public function testFilterOnReadingTimeOnlyLower() 765 public function testFilterOnReadingTimeOnlyLower()
769 { 766 {
770 $this->logInAs('admin'); 767 $this->logInAs('admin');
771 $this->useTheme('baggy');
772 $client = $this->getClient(); 768 $client = $this->getClient();
773 769
774 $crawler = $client->request('GET', '/unread/list'); 770 $crawler = $client->request('GET', '/unread/list');
@@ -781,7 +777,7 @@ class EntryControllerTest extends WallabagCoreTestCase
781 777
782 $crawler = $client->submit($form, $data); 778 $crawler = $client->submit($form, $data);
783 779
784 $this->assertCount(0, $crawler->filter('div[class=entry]')); 780 $this->assertCount(0, $crawler->filter('li.entry'));
785 781
786 $entry = new Entry($this->getLoggedInUser()); 782 $entry = new Entry($this->getLoggedInUser());
787 $entry->setUrl($this->url); 783 $entry->setUrl($this->url);
@@ -790,13 +786,12 @@ class EntryControllerTest extends WallabagCoreTestCase
790 $this->getEntityManager()->flush(); 786 $this->getEntityManager()->flush();
791 787
792 $crawler = $client->submit($form, $data); 788 $crawler = $client->submit($form, $data);
793 $this->assertCount(1, $crawler->filter('div[class=entry]')); 789 $this->assertCount(1, $crawler->filter('li.entry'));
794 } 790 }
795 791
796 public function testFilterOnUnreadStatus() 792 public function testFilterOnUnreadStatus()
797 { 793 {
798 $this->logInAs('admin'); 794 $this->logInAs('admin');
799 $this->useTheme('baggy');
800 $client = $this->getClient(); 795 $client = $this->getClient();
801 796
802 $crawler = $client->request('GET', '/all/list'); 797 $crawler = $client->request('GET', '/all/list');
@@ -809,7 +804,7 @@ class EntryControllerTest extends WallabagCoreTestCase
809 804
810 $crawler = $client->submit($form, $data); 805 $crawler = $client->submit($form, $data);
811 806
812 $this->assertCount(4, $crawler->filter('div[class=entry]')); 807 $this->assertCount(4, $crawler->filter('li.entry'));
813 808
814 $entry = new Entry($this->getLoggedInUser()); 809 $entry = new Entry($this->getLoggedInUser());
815 $entry->setUrl($this->url); 810 $entry->setUrl($this->url);
@@ -819,13 +814,12 @@ class EntryControllerTest extends WallabagCoreTestCase
819 814
820 $crawler = $client->submit($form, $data); 815 $crawler = $client->submit($form, $data);
821 816
822 $this->assertCount(5, $crawler->filter('div[class=entry]')); 817 $this->assertCount(5, $crawler->filter('li.entry'));
823 } 818 }
824 819
825 public function testFilterOnCreationDate() 820 public function testFilterOnCreationDate()
826 { 821 {
827 $this->logInAs('admin'); 822 $this->logInAs('admin');
828 $this->useTheme('baggy');
829 $client = $this->getClient(); 823 $client = $this->getClient();
830 824
831 $crawler = $client->request('GET', '/unread/list'); 825 $crawler = $client->request('GET', '/unread/list');
@@ -839,7 +833,7 @@ class EntryControllerTest extends WallabagCoreTestCase
839 833
840 $crawler = $client->submit($form, $data); 834 $crawler = $client->submit($form, $data);
841 835
842 $this->assertCount(5, $crawler->filter('div[class=entry]')); 836 $this->assertCount(5, $crawler->filter('li.entry'));
843 837
844 $data = [ 838 $data = [
845 'entry_filter[createdAt][left_date]' => date('d/m/Y'), 839 'entry_filter[createdAt][left_date]' => date('d/m/Y'),
@@ -848,7 +842,7 @@ class EntryControllerTest extends WallabagCoreTestCase
848 842
849 $crawler = $client->submit($form, $data); 843 $crawler = $client->submit($form, $data);
850 844
851 $this->assertCount(5, $crawler->filter('div[class=entry]')); 845 $this->assertCount(5, $crawler->filter('li.entry'));
852 846
853 $data = [ 847 $data = [
854 'entry_filter[createdAt][left_date]' => '01/01/1970', 848 'entry_filter[createdAt][left_date]' => '01/01/1970',
@@ -857,7 +851,7 @@ class EntryControllerTest extends WallabagCoreTestCase
857 851
858 $crawler = $client->submit($form, $data); 852 $crawler = $client->submit($form, $data);
859 853
860 $this->assertCount(0, $crawler->filter('div[class=entry]')); 854 $this->assertCount(0, $crawler->filter('li.entry'));
861 } 855 }
862 856
863 public function testPaginationWithFilter() 857 public function testPaginationWithFilter()
@@ -892,7 +886,6 @@ class EntryControllerTest extends WallabagCoreTestCase
892 public function testFilterOnDomainName() 886 public function testFilterOnDomainName()
893 { 887 {
894 $this->logInAs('admin'); 888 $this->logInAs('admin');
895 $this->useTheme('baggy');
896 $client = $this->getClient(); 889 $client = $this->getClient();
897 890
898 $crawler = $client->request('GET', '/unread/list'); 891 $crawler = $client->request('GET', '/unread/list');
@@ -902,7 +895,7 @@ class EntryControllerTest extends WallabagCoreTestCase
902 ]; 895 ];
903 896
904 $crawler = $client->submit($form, $data); 897 $crawler = $client->submit($form, $data);
905 $this->assertCount(5, $crawler->filter('div[class=entry]')); 898 $this->assertCount(5, $crawler->filter('li.entry'));
906 899
907 $crawler = $client->request('GET', '/unread/list'); 900 $crawler = $client->request('GET', '/unread/list');
908 $form = $crawler->filter('button[id=submit-filter]')->form(); 901 $form = $crawler->filter('button[id=submit-filter]')->form();
@@ -911,7 +904,7 @@ class EntryControllerTest extends WallabagCoreTestCase
911 ]; 904 ];
912 905
913 $crawler = $client->submit($form, $data); 906 $crawler = $client->submit($form, $data);
914 $this->assertCount(5, $crawler->filter('div[class=entry]')); 907 $this->assertCount(5, $crawler->filter('li.entry'));
915 908
916 $form = $crawler->filter('button[id=submit-filter]')->form(); 909 $form = $crawler->filter('button[id=submit-filter]')->form();
917 $data = [ 910 $data = [
@@ -919,13 +912,12 @@ class EntryControllerTest extends WallabagCoreTestCase
919 ]; 912 ];
920 913
921 $crawler = $client->submit($form, $data); 914 $crawler = $client->submit($form, $data);
922 $this->assertCount(0, $crawler->filter('div[class=entry]')); 915 $this->assertCount(0, $crawler->filter('li.entry'));
923 } 916 }
924 917
925 public function testFilterOnStatus() 918 public function testFilterOnStatus()
926 { 919 {
927 $this->logInAs('admin'); 920 $this->logInAs('admin');
928 $this->useTheme('baggy');
929 $client = $this->getClient(); 921 $client = $this->getClient();
930 922
931 $crawler = $client->request('GET', '/unread/list'); 923 $crawler = $client->request('GET', '/unread/list');
@@ -934,20 +926,19 @@ class EntryControllerTest extends WallabagCoreTestCase
934 $form['entry_filter[isStarred]']->untick(); 926 $form['entry_filter[isStarred]']->untick();
935 927
936 $crawler = $client->submit($form); 928 $crawler = $client->submit($form);
937 $this->assertCount(1, $crawler->filter('div[class=entry]')); 929 $this->assertCount(1, $crawler->filter('li.entry'));
938 930
939 $form = $crawler->filter('button[id=submit-filter]')->form(); 931 $form = $crawler->filter('button[id=submit-filter]')->form();
940 $form['entry_filter[isArchived]']->untick(); 932 $form['entry_filter[isArchived]']->untick();
941 $form['entry_filter[isStarred]']->tick(); 933 $form['entry_filter[isStarred]']->tick();
942 934
943 $crawler = $client->submit($form); 935 $crawler = $client->submit($form);
944 $this->assertCount(1, $crawler->filter('div[class=entry]')); 936 $this->assertCount(1, $crawler->filter('li.entry'));
945 } 937 }
946 938
947 public function testFilterOnIsPublic() 939 public function testFilterOnIsPublic()
948 { 940 {
949 $this->logInAs('admin'); 941 $this->logInAs('admin');
950 $this->useTheme('baggy');
951 $client = $this->getClient(); 942 $client = $this->getClient();
952 943
953 $crawler = $client->request('GET', '/unread/list'); 944 $crawler = $client->request('GET', '/unread/list');
@@ -955,13 +946,12 @@ class EntryControllerTest extends WallabagCoreTestCase
955 $form['entry_filter[isPublic]']->tick(); 946 $form['entry_filter[isPublic]']->tick();
956 947
957 $crawler = $client->submit($form); 948 $crawler = $client->submit($form);
958 $this->assertCount(0, $crawler->filter('div[class=entry]')); 949 $this->assertCount(0, $crawler->filter('li.entry'));
959 } 950 }
960 951
961 public function testPreviewPictureFilter() 952 public function testPreviewPictureFilter()
962 { 953 {
963 $this->logInAs('admin'); 954 $this->logInAs('admin');
964 $this->useTheme('baggy');
965 $client = $this->getClient(); 955 $client = $this->getClient();
966 956
967 $crawler = $client->request('GET', '/unread/list'); 957 $crawler = $client->request('GET', '/unread/list');
@@ -969,13 +959,12 @@ class EntryControllerTest extends WallabagCoreTestCase
969 $form['entry_filter[previewPicture]']->tick(); 959 $form['entry_filter[previewPicture]']->tick();
970 960
971 $crawler = $client->submit($form); 961 $crawler = $client->submit($form);
972 $this->assertCount(1, $crawler->filter('div[class=entry]')); 962 $this->assertCount(1, $crawler->filter('li.entry'));
973 } 963 }
974 964
975 public function testFilterOnLanguage() 965 public function testFilterOnLanguage()
976 { 966 {
977 $this->logInAs('admin'); 967 $this->logInAs('admin');
978 $this->useTheme('baggy');
979 $client = $this->getClient(); 968 $client = $this->getClient();
980 969
981 $entry = new Entry($this->getLoggedInUser()); 970 $entry = new Entry($this->getLoggedInUser());
@@ -991,7 +980,7 @@ class EntryControllerTest extends WallabagCoreTestCase
991 ]; 980 ];
992 981
993 $crawler = $client->submit($form, $data); 982 $crawler = $client->submit($form, $data);
994 $this->assertCount(3, $crawler->filter('div[class=entry]')); 983 $this->assertCount(3, $crawler->filter('li.entry'));
995 984
996 $form = $crawler->filter('button[id=submit-filter]')->form(); 985 $form = $crawler->filter('button[id=submit-filter]')->form();
997 $data = [ 986 $data = [
@@ -999,7 +988,7 @@ class EntryControllerTest extends WallabagCoreTestCase
999 ]; 988 ];
1000 989
1001 $crawler = $client->submit($form, $data); 990 $crawler = $client->submit($form, $data);
1002 $this->assertCount(2, $crawler->filter('div[class=entry]')); 991 $this->assertCount(2, $crawler->filter('li.entry'));
1003 } 992 }
1004 993
1005 public function testShareEntryPublicly() 994 public function testShareEntryPublicly()
@@ -1181,7 +1170,6 @@ class EntryControllerTest extends WallabagCoreTestCase
1181 public function testFilterOnHttpStatus() 1170 public function testFilterOnHttpStatus()
1182 { 1171 {
1183 $this->logInAs('admin'); 1172 $this->logInAs('admin');
1184 $this->useTheme('baggy');
1185 $client = $this->getClient(); 1173 $client = $this->getClient();
1186 1174
1187 $entry = new Entry($this->getLoggedInUser()); 1175 $entry = new Entry($this->getLoggedInUser());
@@ -1200,7 +1188,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1200 1188
1201 $crawler = $client->submit($form, $data); 1189 $crawler = $client->submit($form, $data);
1202 1190
1203 $this->assertCount(1, $crawler->filter('div[class=entry]')); 1191 $this->assertCount(1, $crawler->filter('li.entry'));
1204 1192
1205 $entry = new Entry($this->getLoggedInUser()); 1193 $entry = new Entry($this->getLoggedInUser());
1206 $entry->setUrl($this->url); 1194 $entry->setUrl($this->url);
@@ -1223,7 +1211,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1223 1211
1224 $crawler = $client->submit($form, $data); 1212 $crawler = $client->submit($form, $data);
1225 1213
1226 $this->assertCount(2, $crawler->filter('div[class=entry]')); 1214 $this->assertCount(2, $crawler->filter('li.entry'));
1227 1215
1228 $crawler = $client->request('GET', '/all/list'); 1216 $crawler = $client->request('GET', '/all/list');
1229 $form = $crawler->filter('button[id=submit-filter]')->form(); 1217 $form = $crawler->filter('button[id=submit-filter]')->form();
@@ -1234,13 +1222,12 @@ class EntryControllerTest extends WallabagCoreTestCase
1234 1222
1235 $crawler = $client->submit($form, $data); 1223 $crawler = $client->submit($form, $data);
1236 1224
1237 $this->assertCount(8, $crawler->filter('div[class=entry]')); 1225 $this->assertCount(8, $crawler->filter('li.entry'));
1238 } 1226 }
1239 1227
1240 public function testSearch() 1228 public function testSearch()
1241 { 1229 {
1242 $this->logInAs('admin'); 1230 $this->logInAs('admin');
1243 $this->useTheme('baggy');
1244 $client = $this->getClient(); 1231 $client = $this->getClient();
1245 1232
1246 $entry = new Entry($this->getLoggedInUser()); 1233 $entry = new Entry($this->getLoggedInUser());
@@ -1259,7 +1246,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1259 1246
1260 $crawler = $client->submit($form, $data); 1247 $crawler = $client->submit($form, $data);
1261 1248
1262 $this->assertCount(4, $crawler->filter('div[class=entry]')); 1249 $this->assertCount(4, $crawler->filter('li.entry'));
1263 1250
1264 // Search on starred list 1251 // Search on starred list
1265 $crawler = $client->request('GET', '/starred/list'); 1252 $crawler = $client->request('GET', '/starred/list');
@@ -1278,7 +1265,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1278 1265
1279 $crawler = $client->submit($form, $data); 1266 $crawler = $client->submit($form, $data);
1280 1267
1281 $this->assertCount(1, $crawler->filter('div[class=entry]')); 1268 $this->assertCount(1, $crawler->filter('li.entry'));
1282 1269
1283 $crawler = $client->request('GET', '/archive/list'); 1270 $crawler = $client->request('GET', '/archive/list');
1284 1271
@@ -1297,7 +1284,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1297 1284
1298 $crawler = $client->submit($form, $data); 1285 $crawler = $client->submit($form, $data);
1299 1286
1300 $this->assertCount(1, $crawler->filter('div[class=entry]')); 1287 $this->assertCount(1, $crawler->filter('li.entry'));
1301 $client->request('GET', '/delete/' . $entry->getId()); 1288 $client->request('GET', '/delete/' . $entry->getId());
1302 1289
1303 // test on list of all articles 1290 // test on list of all articles
@@ -1310,7 +1297,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1310 1297
1311 $crawler = $client->submit($form, $data); 1298 $crawler = $client->submit($form, $data);
1312 1299
1313 $this->assertCount(0, $crawler->filter('div[class=entry]')); 1300 $this->assertCount(0, $crawler->filter('li.entry'));
1314 1301
1315 // test url search on list of all articles 1302 // test url search on list of all articles
1316 $entry = new Entry($this->getLoggedInUser()); 1303 $entry = new Entry($this->getLoggedInUser());
@@ -1329,7 +1316,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1329 1316
1330 $crawler = $client->submit($form, $data); 1317 $crawler = $client->submit($form, $data);
1331 1318
1332 $this->assertCount(1, $crawler->filter('div[class=entry]')); 1319 $this->assertCount(1, $crawler->filter('li.entry'));
1333 1320
1334 // same as previous test but for case-sensitivity 1321 // same as previous test but for case-sensitivity
1335 $crawler = $client->request('GET', '/all/list'); 1322 $crawler = $client->request('GET', '/all/list');
@@ -1341,7 +1328,7 @@ class EntryControllerTest extends WallabagCoreTestCase
1341 1328
1342 $crawler = $client->submit($form, $data); 1329 $crawler = $client->submit($form, $data);
1343 1330
1344 $this->assertCount(1, $crawler->filter('div[class=entry]')); 1331 $this->assertCount(1, $crawler->filter('li.entry'));
1345 } 1332 }
1346 1333
1347 public function dataForLanguage() 1334 public function dataForLanguage()