]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Wallabag\CoreBundle\Tests\Controller; | |
4 | ||
5 | use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; | |
6 | use Wallabag\CoreBundle\Entity\Entry; | |
7 | ||
8 | class EntryControllerTest extends WallabagCoreTestCase | |
9 | { | |
10 | public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; | |
11 | ||
12 | public function testLogin() | |
13 | { | |
14 | $client = $this->getClient(); | |
15 | ||
16 | $client->request('GET', '/new'); | |
17 | ||
18 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
19 | $this->assertContains('login', $client->getResponse()->headers->get('location')); | |
20 | } | |
21 | ||
22 | public function testQuickstart() | |
23 | { | |
24 | $this->logInAs('empty'); | |
25 | $client = $this->getClient(); | |
26 | ||
27 | $client->request('GET', '/unread/list'); | |
28 | $crawler = $client->followRedirect(); | |
29 | ||
30 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
31 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | |
32 | $this->assertContains('quickstart.intro.paragraph_1', $body[0]); | |
33 | ||
34 | // Test if quickstart is disabled when user has 1 entry | |
35 | $crawler = $client->request('GET', '/new'); | |
36 | ||
37 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
38 | ||
39 | $form = $crawler->filter('form[name=entry]')->form(); | |
40 | ||
41 | $data = array( | |
42 | 'entry[url]' => $this->url, | |
43 | ); | |
44 | ||
45 | $client->submit($form, $data); | |
46 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
47 | $client->followRedirect(); | |
48 | ||
49 | $crawler = $client->request('GET', '/unread/list'); | |
50 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | |
51 | $this->assertContains('entry.list.number_on_the_page', $body[0]); | |
52 | } | |
53 | ||
54 | public function testGetNew() | |
55 | { | |
56 | $this->logInAs('admin'); | |
57 | $client = $this->getClient(); | |
58 | ||
59 | $crawler = $client->request('GET', '/new'); | |
60 | ||
61 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
62 | ||
63 | $this->assertCount(1, $crawler->filter('input[type=url]')); | |
64 | $this->assertCount(1, $crawler->filter('form[name=entry]')); | |
65 | } | |
66 | ||
67 | public function testPostNewViaBookmarklet() | |
68 | { | |
69 | $this->logInAs('admin'); | |
70 | $client = $this->getClient(); | |
71 | ||
72 | $crawler = $client->request('GET', '/'); | |
73 | ||
74 | $this->assertCount(4, $crawler->filter('div[class=entry]')); | |
75 | ||
76 | // Good URL | |
77 | $client->request('GET', '/bookmarklet', array('url' => $this->url)); | |
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
79 | $client->followRedirect(); | |
80 | $crawler = $client->request('GET', '/'); | |
81 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | |
82 | ||
83 | $em = $client->getContainer() | |
84 | ->get('doctrine.orm.entity_manager'); | |
85 | $entry = $em | |
86 | ->getRepository('WallabagCoreBundle:Entry') | |
87 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
88 | $em->remove($entry); | |
89 | $em->flush(); | |
90 | } | |
91 | ||
92 | public function testPostNewEmpty() | |
93 | { | |
94 | $this->logInAs('admin'); | |
95 | $client = $this->getClient(); | |
96 | ||
97 | $crawler = $client->request('GET', '/new'); | |
98 | ||
99 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
100 | ||
101 | $form = $crawler->filter('form[name=entry]')->form(); | |
102 | ||
103 | $crawler = $client->submit($form); | |
104 | ||
105 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
106 | $this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(array('_text'))); | |
107 | $this->assertEquals('This value should not be blank.', $alert[0]); | |
108 | } | |
109 | ||
110 | /** | |
111 | * This test will require an internet connection. | |
112 | */ | |
113 | public function testPostNewOk() | |
114 | { | |
115 | $this->logInAs('admin'); | |
116 | $client = $this->getClient(); | |
117 | ||
118 | $crawler = $client->request('GET', '/new'); | |
119 | ||
120 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
121 | ||
122 | $form = $crawler->filter('form[name=entry]')->form(); | |
123 | ||
124 | $data = array( | |
125 | 'entry[url]' => $this->url, | |
126 | ); | |
127 | ||
128 | $client->submit($form, $data); | |
129 | ||
130 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
131 | ||
132 | $content = $client->getContainer() | |
133 | ->get('doctrine.orm.entity_manager') | |
134 | ->getRepository('WallabagCoreBundle:Entry') | |
135 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
136 | ||
137 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | |
138 | $this->assertEquals($this->url, $content->getUrl()); | |
139 | $this->assertContains('Google', $content->getTitle()); | |
140 | } | |
141 | ||
142 | public function testPostNewOkUrlExist() | |
143 | { | |
144 | $this->logInAs('admin'); | |
145 | $client = $this->getClient(); | |
146 | ||
147 | $crawler = $client->request('GET', '/new'); | |
148 | ||
149 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
150 | ||
151 | $form = $crawler->filter('form[name=entry]')->form(); | |
152 | ||
153 | $data = array( | |
154 | 'entry[url]' => $this->url, | |
155 | ); | |
156 | ||
157 | $client->submit($form, $data); | |
158 | ||
159 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
160 | $this->assertContains('/view/', $client->getResponse()->getTargetUrl()); | |
161 | } | |
162 | ||
163 | /** | |
164 | * This test will require an internet connection. | |
165 | */ | |
166 | public function testPostNewThatWillBeTaggued() | |
167 | { | |
168 | $this->logInAs('admin'); | |
169 | $client = $this->getClient(); | |
170 | ||
171 | $crawler = $client->request('GET', '/new'); | |
172 | ||
173 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
174 | ||
175 | $form = $crawler->filter('form[name=entry]')->form(); | |
176 | ||
177 | $data = array( | |
178 | 'entry[url]' => $url = 'https://github.com/wallabag/wallabag', | |
179 | ); | |
180 | ||
181 | $client->submit($form, $data); | |
182 | ||
183 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
184 | ||
185 | $client->followRedirect(); | |
186 | ||
187 | $em = $client->getContainer() | |
188 | ->get('doctrine.orm.entity_manager'); | |
189 | $entry = $em | |
190 | ->getRepository('WallabagCoreBundle:Entry') | |
191 | ->findOneByUrl($url); | |
192 | $tags = $entry->getTags(); | |
193 | ||
194 | $this->assertCount(1, $tags); | |
195 | $this->assertEquals('wallabag', $tags[0]->getLabel()); | |
196 | ||
197 | $em->remove($entry); | |
198 | $em->flush(); | |
199 | } | |
200 | ||
201 | public function testArchive() | |
202 | { | |
203 | $this->logInAs('admin'); | |
204 | $client = $this->getClient(); | |
205 | ||
206 | $client->request('GET', '/archive/list'); | |
207 | ||
208 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
209 | } | |
210 | ||
211 | public function testStarred() | |
212 | { | |
213 | $this->logInAs('admin'); | |
214 | $client = $this->getClient(); | |
215 | ||
216 | $client->request('GET', '/starred/list'); | |
217 | ||
218 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
219 | } | |
220 | ||
221 | public function testRangeException() | |
222 | { | |
223 | $this->logInAs('admin'); | |
224 | $client = $this->getClient(); | |
225 | ||
226 | $client->request('GET', '/all/list/900'); | |
227 | ||
228 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); | |
229 | } | |
230 | ||
231 | /** | |
232 | * @depends testPostNewOk | |
233 | */ | |
234 | public function testView() | |
235 | { | |
236 | $this->logInAs('admin'); | |
237 | $client = $this->getClient(); | |
238 | ||
239 | $content = $client->getContainer() | |
240 | ->get('doctrine.orm.entity_manager') | |
241 | ->getRepository('WallabagCoreBundle:Entry') | |
242 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
243 | ||
244 | $crawler = $client->request('GET', '/view/'.$content->getId()); | |
245 | ||
246 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
247 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); | |
248 | $this->assertContains($content->getTitle(), $body[0]); | |
249 | } | |
250 | ||
251 | /** | |
252 | * @depends testPostNewOk | |
253 | * | |
254 | * This test will require an internet connection. | |
255 | */ | |
256 | public function testReload() | |
257 | { | |
258 | $this->logInAs('admin'); | |
259 | $client = $this->getClient(); | |
260 | ||
261 | $content = $client->getContainer() | |
262 | ->get('doctrine.orm.entity_manager') | |
263 | ->getRepository('WallabagCoreBundle:Entry') | |
264 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
265 | ||
266 | // empty content | |
267 | $content->setContent(''); | |
268 | $client->getContainer()->get('doctrine.orm.entity_manager')->persist($content); | |
269 | $client->getContainer()->get('doctrine.orm.entity_manager')->flush(); | |
270 | ||
271 | $client->request('GET', '/reload/'.$content->getId()); | |
272 | ||
273 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
274 | ||
275 | $content = $client->getContainer() | |
276 | ->get('doctrine.orm.entity_manager') | |
277 | ->getRepository('WallabagCoreBundle:Entry') | |
278 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
279 | ||
280 | $this->assertNotEmpty($content->getContent()); | |
281 | } | |
282 | ||
283 | public function testEdit() | |
284 | { | |
285 | $this->logInAs('admin'); | |
286 | $client = $this->getClient(); | |
287 | ||
288 | $content = $client->getContainer() | |
289 | ->get('doctrine.orm.entity_manager') | |
290 | ->getRepository('WallabagCoreBundle:Entry') | |
291 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
292 | ||
293 | $crawler = $client->request('GET', '/edit/'.$content->getId()); | |
294 | ||
295 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
296 | ||
297 | $this->assertCount(1, $crawler->filter('input[id=entry_title]')); | |
298 | $this->assertCount(1, $crawler->filter('button[id=entry_save]')); | |
299 | } | |
300 | ||
301 | public function testEditUpdate() | |
302 | { | |
303 | $this->logInAs('admin'); | |
304 | $client = $this->getClient(); | |
305 | ||
306 | $content = $client->getContainer() | |
307 | ->get('doctrine.orm.entity_manager') | |
308 | ->getRepository('WallabagCoreBundle:Entry') | |
309 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
310 | ||
311 | $crawler = $client->request('GET', '/edit/'.$content->getId()); | |
312 | ||
313 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
314 | ||
315 | $form = $crawler->filter('button[type=submit]')->form(); | |
316 | ||
317 | $data = array( | |
318 | 'entry[title]' => 'My updated title hehe :)', | |
319 | ); | |
320 | ||
321 | $client->submit($form, $data); | |
322 | ||
323 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
324 | ||
325 | $crawler = $client->followRedirect(); | |
326 | ||
327 | $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(array('_text'))); | |
328 | $this->assertContains('My updated title hehe :)', $alert[0]); | |
329 | } | |
330 | ||
331 | public function testToggleArchive() | |
332 | { | |
333 | $this->logInAs('admin'); | |
334 | $client = $this->getClient(); | |
335 | ||
336 | $content = $client->getContainer() | |
337 | ->get('doctrine.orm.entity_manager') | |
338 | ->getRepository('WallabagCoreBundle:Entry') | |
339 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
340 | ||
341 | $client->request('GET', '/archive/'.$content->getId()); | |
342 | ||
343 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
344 | ||
345 | $res = $client->getContainer() | |
346 | ->get('doctrine.orm.entity_manager') | |
347 | ->getRepository('WallabagCoreBundle:Entry') | |
348 | ->find($content->getId()); | |
349 | ||
350 | $this->assertEquals($res->isArchived(), true); | |
351 | } | |
352 | ||
353 | public function testToggleStar() | |
354 | { | |
355 | $this->logInAs('admin'); | |
356 | $client = $this->getClient(); | |
357 | ||
358 | $content = $client->getContainer() | |
359 | ->get('doctrine.orm.entity_manager') | |
360 | ->getRepository('WallabagCoreBundle:Entry') | |
361 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
362 | ||
363 | $client->request('GET', '/star/'.$content->getId()); | |
364 | ||
365 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
366 | ||
367 | $res = $client->getContainer() | |
368 | ->get('doctrine.orm.entity_manager') | |
369 | ->getRepository('WallabagCoreBundle:Entry') | |
370 | ->findOneById($content->getId()); | |
371 | ||
372 | $this->assertEquals($res->isStarred(), true); | |
373 | } | |
374 | ||
375 | public function testDelete() | |
376 | { | |
377 | $this->logInAs('admin'); | |
378 | $client = $this->getClient(); | |
379 | ||
380 | $content = $client->getContainer() | |
381 | ->get('doctrine.orm.entity_manager') | |
382 | ->getRepository('WallabagCoreBundle:Entry') | |
383 | ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); | |
384 | ||
385 | $client->request('GET', '/delete/'.$content->getId()); | |
386 | ||
387 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
388 | ||
389 | $client->request('GET', '/delete/'.$content->getId()); | |
390 | ||
391 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); | |
392 | } | |
393 | ||
394 | /** | |
395 | * It will create a new entry. | |
396 | * Browse to it. | |
397 | * Then remove it. | |
398 | * | |
399 | * And it'll check that user won't be redirected to the view page of the content when it had been removed | |
400 | */ | |
401 | public function testViewAndDelete() | |
402 | { | |
403 | $this->logInAs('admin'); | |
404 | $client = $this->getClient(); | |
405 | ||
406 | // add a new content to be removed later | |
407 | $user = $client->getContainer() | |
408 | ->get('doctrine.orm.entity_manager') | |
409 | ->getRepository('WallabagUserBundle:User') | |
410 | ->findOneByUserName('admin'); | |
411 | ||
412 | $content = new Entry($user); | |
413 | $content->setUrl('http://1.1.1.1/entry'); | |
414 | $content->setReadingTime(12); | |
415 | $content->setDomainName('domain.io'); | |
416 | $content->setMimetype('text/html'); | |
417 | $content->setTitle('test title entry'); | |
418 | $content->setContent('This is my content /o/'); | |
419 | $content->setArchived(true); | |
420 | $content->setLanguage('fr'); | |
421 | ||
422 | $client->getContainer() | |
423 | ->get('doctrine.orm.entity_manager') | |
424 | ->persist($content); | |
425 | $client->getContainer() | |
426 | ->get('doctrine.orm.entity_manager') | |
427 | ->flush(); | |
428 | ||
429 | $client->request('GET', '/view/'.$content->getId()); | |
430 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
431 | ||
432 | $client->request('GET', '/delete/'.$content->getId()); | |
433 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | |
434 | ||
435 | $client->followRedirect(); | |
436 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
437 | } | |
438 | ||
439 | public function testViewOtherUserEntry() | |
440 | { | |
441 | $this->logInAs('admin'); | |
442 | $client = $this->getClient(); | |
443 | ||
444 | $content = $client->getContainer() | |
445 | ->get('doctrine.orm.entity_manager') | |
446 | ->getRepository('WallabagCoreBundle:Entry') | |
447 | ->findOneByUsernameAndNotArchived('bob'); | |
448 | ||
449 | $client->request('GET', '/view/'.$content->getId()); | |
450 | ||
451 | $this->assertEquals(403, $client->getResponse()->getStatusCode()); | |
452 | } | |
453 | ||
454 | public function testFilterOnReadingTime() | |
455 | { | |
456 | $this->logInAs('admin'); | |
457 | $client = $this->getClient(); | |
458 | ||
459 | $crawler = $client->request('GET', '/unread/list'); | |
460 | ||
461 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
462 | ||
463 | $data = array( | |
464 | 'entry_filter[readingTime][right_number]' => 11, | |
465 | 'entry_filter[readingTime][left_number]' => 11, | |
466 | ); | |
467 | ||
468 | $crawler = $client->submit($form, $data); | |
469 | ||
470 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | |
471 | } | |
472 | ||
473 | public function testFilterOnCreationDate() | |
474 | { | |
475 | $this->logInAs('admin'); | |
476 | $client = $this->getClient(); | |
477 | ||
478 | $crawler = $client->request('GET', '/unread/list'); | |
479 | ||
480 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
481 | ||
482 | $data = array( | |
483 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), | |
484 | 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')), | |
485 | ); | |
486 | ||
487 | $crawler = $client->submit($form, $data); | |
488 | ||
489 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | |
490 | ||
491 | $data = array( | |
492 | 'entry_filter[createdAt][left_date]' => date('d/m/Y'), | |
493 | 'entry_filter[createdAt][right_date]' => date('d/m/Y'), | |
494 | ); | |
495 | ||
496 | $crawler = $client->submit($form, $data); | |
497 | ||
498 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | |
499 | ||
500 | $data = array( | |
501 | 'entry_filter[createdAt][left_date]' => '01/01/1970', | |
502 | 'entry_filter[createdAt][right_date]' => '01/01/1970', | |
503 | ); | |
504 | ||
505 | $crawler = $client->submit($form, $data); | |
506 | ||
507 | $this->assertCount(0, $crawler->filter('div[class=entry]')); | |
508 | } | |
509 | ||
510 | public function testPaginationWithFilter() | |
511 | { | |
512 | $this->logInAs('admin'); | |
513 | $client = $this->getClient(); | |
514 | $crawler = $client->request('GET', '/config'); | |
515 | ||
516 | $form = $crawler->filter('button[id=config_save]')->form(); | |
517 | ||
518 | $data = array( | |
519 | 'config[items_per_page]' => '1', | |
520 | ); | |
521 | ||
522 | $client->submit($form, $data); | |
523 | ||
524 | $parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&entry_filter%5BreadingTime%5D%5Bright_number%5D='; | |
525 | ||
526 | $client->request('GET', 'unread/list'.$parameters); | |
527 | ||
528 | $this->assertContains($parameters, $client->getResponse()->getContent()); | |
529 | ||
530 | // reset pagination | |
531 | $crawler = $client->request('GET', '/config'); | |
532 | $form = $crawler->filter('button[id=config_save]')->form(); | |
533 | $data = array( | |
534 | 'config[items_per_page]' => '12', | |
535 | ); | |
536 | $client->submit($form, $data); | |
537 | } | |
538 | ||
539 | public function testFilterOnDomainName() | |
540 | { | |
541 | $this->logInAs('admin'); | |
542 | $client = $this->getClient(); | |
543 | ||
544 | $crawler = $client->request('GET', '/unread/list'); | |
545 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
546 | $data = array( | |
547 | 'entry_filter[domainName]' => 'domain', | |
548 | ); | |
549 | ||
550 | $crawler = $client->submit($form, $data); | |
551 | $this->assertCount(5, $crawler->filter('div[class=entry]')); | |
552 | ||
553 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
554 | $data = array( | |
555 | 'entry_filter[domainName]' => 'wallabag', | |
556 | ); | |
557 | ||
558 | $crawler = $client->submit($form, $data); | |
559 | $this->assertCount(0, $crawler->filter('div[class=entry]')); | |
560 | } | |
561 | ||
562 | public function testFilterOnStatus() | |
563 | { | |
564 | $this->logInAs('admin'); | |
565 | $client = $this->getClient(); | |
566 | ||
567 | $crawler = $client->request('GET', '/unread/list'); | |
568 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
569 | $form['entry_filter[isArchived]']->tick(); | |
570 | $form['entry_filter[isStarred]']->untick(); | |
571 | ||
572 | $crawler = $client->submit($form); | |
573 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | |
574 | ||
575 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
576 | $form['entry_filter[isArchived]']->untick(); | |
577 | $form['entry_filter[isStarred]']->tick(); | |
578 | ||
579 | $crawler = $client->submit($form); | |
580 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | |
581 | } | |
582 | ||
583 | public function testPreviewPictureFilter() | |
584 | { | |
585 | $this->logInAs('admin'); | |
586 | $client = $this->getClient(); | |
587 | ||
588 | $crawler = $client->request('GET', '/unread/list'); | |
589 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
590 | $form['entry_filter[previewPicture]']->tick(); | |
591 | ||
592 | $crawler = $client->submit($form); | |
593 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | |
594 | } | |
595 | ||
596 | public function testFilterOnLanguage() | |
597 | { | |
598 | $this->logInAs('admin'); | |
599 | $client = $this->getClient(); | |
600 | ||
601 | $crawler = $client->request('GET', '/unread/list'); | |
602 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
603 | $data = array( | |
604 | 'entry_filter[language]' => 'fr', | |
605 | ); | |
606 | ||
607 | $crawler = $client->submit($form, $data); | |
608 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | |
609 | ||
610 | $form = $crawler->filter('button[id=submit-filter]')->form(); | |
611 | $data = array( | |
612 | 'entry_filter[language]' => 'en', | |
613 | ); | |
614 | ||
615 | $crawler = $client->submit($form, $data); | |
616 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | |
617 | } | |
618 | } |