From d4ebe5c5dcf581416ab76136908cafbde78f63bf Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 23 Sep 2015 07:55:55 +0200 Subject: Entries filter on language + updated deps --- composer.lock | 221 +++++++++++++++------ .../CoreBundle/Controller/EntryController.php | 2 +- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 6 + src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 23 ++- .../CoreBundle/Repository/EntryRepository.php | 27 +++ .../views/themes/baggy/Entry/entries.html.twig | 8 + .../views/themes/material/Entry/entries.html.twig | 10 +- .../Tests/Controller/EntryControllerTest.php | 23 +++ 8 files changed, 255 insertions(+), 65 deletions(-) diff --git a/composer.lock b/composer.lock index d8c55fda..ef060b5e 100644 --- a/composer.lock +++ b/composer.lock @@ -285,16 +285,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "628c2256b646ae2417d44e063bce8aec5199d48d" + "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/628c2256b646ae2417d44e063bce8aec5199d48d", - "reference": "628c2256b646ae2417d44e063bce8aec5199d48d", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/01dbcbc5cd0a913d751418e635434a18a2f2a75c", + "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c", "shasum": "" }, "require": { @@ -352,20 +352,20 @@ "persistence", "queryobject" ], - "time": "2015-01-12 21:52:47" + "time": "2015-09-16 16:29:33" }, { "name": "doctrine/doctrine-bundle", - "version": "v1.5.1", + "version": "v1.5.2", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01" + "reference": "d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", - "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3", + "reference": "d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3", "shasum": "" }, "require": { @@ -392,7 +392,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -430,7 +430,7 @@ "orm", "persistence" ], - "time": "2015-08-12 15:52:00" + "time": "2015-08-31 14:47:06" }, { "name": "doctrine/doctrine-cache-bundle", @@ -948,12 +948,12 @@ "source": { "type": "git", "url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git", - "reference": "6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60" + "reference": "d5b28c367d393f9d9fbc48c4138b2a74d51c0c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60", - "reference": "6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60", + "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/d5b28c367d393f9d9fbc48c4138b2a74d51c0c83", + "reference": "d5b28c367d393f9d9fbc48c4138b2a74d51c0c83", "shasum": "" }, "require": { @@ -1007,7 +1007,7 @@ "keywords": [ "User management" ], - "time": "2015-09-07 08:53:52" + "time": "2015-09-15 13:15:07" }, { "name": "guzzlehttp/guzzle", @@ -1267,16 +1267,16 @@ }, { "name": "j0k3r/graby", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "source": { "type": "git", "url": "https://github.com/j0k3r/graby.git", - "reference": "9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c" + "reference": "9cc399bbe70f12b302ea65e604a80ea738042599" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/j0k3r/graby/zipball/9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c", - "reference": "9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c", + "url": "https://api.github.com/repos/j0k3r/graby/zipball/9cc399bbe70f12b302ea65e604a80ea738042599", + "reference": "9cc399bbe70f12b302ea65e604a80ea738042599", "shasum": "" }, "require": { @@ -1289,6 +1289,7 @@ "neitanod/forceutf8": "^1.4", "php": ">=5.4", "simplepie/simplepie": "^1.3.1", + "smalot/pdfparser": "~0.9.24", "symfony/options-resolver": "^2.6.6" }, "type": "library", @@ -1314,20 +1315,20 @@ } ], "description": "Graby helps you extract article content from web pages", - "time": "2015-09-13 10:07:45" + "time": "2015-09-17 11:43:10" }, { "name": "j0k3r/graby-site-config", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/j0k3r/graby-site-config.git", - "reference": "9ad65e69bb21397dfededd420e1d4ab22006993c" + "reference": "1b0ac25687aa33785c5d9d8ede92b26f757354f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/9ad65e69bb21397dfededd420e1d4ab22006993c", - "reference": "9ad65e69bb21397dfededd420e1d4ab22006993c", + "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/1b0ac25687aa33785c5d9d8ede92b26f757354f5", + "reference": "1b0ac25687aa33785c5d9d8ede92b26f757354f5", "shasum": "" }, "require": { @@ -1350,20 +1351,20 @@ } ], "description": "Graby site config files", - "time": "2015-09-13 10:26:25" + "time": "2015-09-17 17:32:42" }, { "name": "j0k3r/php-readability", - "version": "v1.0.4", + "version": "v1.0.7", "source": { "type": "git", "url": "https://github.com/j0k3r/php-readability.git", - "reference": "c5a4a490e155fa20809c9bbcf3e318defbb7a261" + "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/c5a4a490e155fa20809c9bbcf3e318defbb7a261", - "reference": "c5a4a490e155fa20809c9bbcf3e318defbb7a261", + "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/1830dc45d4fccfe09d2d107ab59890f07adc35c4", + "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4", "shasum": "" }, "require": { @@ -1413,7 +1414,7 @@ "extraction", "html" ], - "time": "2015-08-24 09:10:54" + "time": "2015-09-20 19:05:55" }, { "name": "jdorn/sql-formatter", @@ -2058,20 +2059,20 @@ }, { "name": "neitanod/forceutf8", - "version": "v1.4", + "version": "v1.5", "source": { "type": "git", "url": "https://github.com/neitanod/forceutf8.git", - "reference": "28d50d579179abac1f6a55b03c6d9d3f6573867c" + "reference": "1b577b9430cb7bd20d8dd7435f36120b85880ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neitanod/forceutf8/zipball/28d50d579179abac1f6a55b03c6d9d3f6573867c", - "reference": "28d50d579179abac1f6a55b03c6d9d3f6573867c", + "url": "https://api.github.com/repos/neitanod/forceutf8/zipball/1b577b9430cb7bd20d8dd7435f36120b85880ace", + "reference": "1b577b9430cb7bd20d8dd7435f36120b85880ace", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": ">=5.3.0" }, "type": "library", "autoload": { @@ -2088,7 +2089,7 @@ ], "description": "PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.", "homepage": "https://github.com/neitanod/forceutf8", - "time": "2014-09-24 14:59:43" + "time": "2015-01-02 13:36:36" }, { "name": "nelmio/api-doc-bundle", @@ -2685,6 +2686,49 @@ ], "time": "2012-10-30 17:54:03" }, + { + "name": "smalot/pdfparser", + "version": "v0.9.25", + "source": { + "type": "git", + "url": "https://github.com/smalot/pdfparser.git", + "reference": "31590f7938a22f1c7fc4fb292611e3742a62ebaa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smalot/pdfparser/zipball/31590f7938a22f1c7fc4fb292611e3742a62ebaa", + "reference": "31590f7938a22f1c7fc4fb292611e3742a62ebaa", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "tecnickcom/tcpdf": ">=6.0.050" + }, + "require-dev": { + "atoum/atoum": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Smalot\\PdfParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0" + ], + "authors": [ + { + "name": "Sebastien MALOT", + "email": "sebastien@malot.fr", + "homepage": "http://www.malot.fr", + "role": "Developer" + } + ], + "description": "Pdf parser library. Can read and extract information from pdf file.", + "homepage": "http://www.pdfparser.org", + "time": "2015-09-18 08:29:33" + }, { "name": "swiftmailer/swiftmailer", "version": "v5.4.1", @@ -3109,6 +3153,69 @@ ], "time": "2015-08-02 12:30:27" }, + { + "name": "tecnickcom/tcpdf", + "version": "6.2.12", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f", + "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "fonts", + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPLv3" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "homepage": "http://nicolaasuni.tecnick.com" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "time": "2015-09-12 10:08:34" + }, { "name": "twig/extensions", "version": "v1.3.0", @@ -3163,16 +3270,16 @@ }, { "name": "twig/twig", - "version": "v1.21.2", + "version": "v1.22.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "ddce1136beb8db29b9cd7dffa8ab518b978c9db3" + "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ddce1136beb8db29b9cd7dffa8ab518b978c9db3", - "reference": "ddce1136beb8db29b9cd7dffa8ab518b978c9db3", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/79249fc8c9ff62e41e217e0c630e2e00bcadda6a", + "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a", "shasum": "" }, "require": { @@ -3185,7 +3292,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.21-dev" + "dev-master": "1.22-dev" } }, "autoload": { @@ -3220,7 +3327,7 @@ "keywords": [ "templating" ], - "time": "2015-09-09 05:28:51" + "time": "2015-09-22 13:59:32" }, { "name": "willdurand/hateoas", @@ -3655,16 +3762,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.2", + "version": "2.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" + "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f", + "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f", "shasum": "" }, "require": { @@ -3713,7 +3820,7 @@ "testing", "xunit" ], - "time": "2015-08-04 03:42:39" + "time": "2015-09-14 06:51:16" }, { "name": "phpunit/php-file-iterator", @@ -3846,16 +3953,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.6", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3ab72c62e550370a6cd5dc873e1a04ab57562f5b", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -3891,20 +3998,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-08-16 08:51:00" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.8.6", + "version": "4.8.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2246830f4a1a551c67933e4171bf2126dc29d357" + "reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2246830f4a1a551c67933e4171bf2126dc29d357", - "reference": "2246830f4a1a551c67933e4171bf2126dc29d357", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/73fad41adb5b7bc3a494bb930d90648df1d5e74b", + "reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b", "shasum": "" }, "require": { @@ -3963,7 +4070,7 @@ "testing", "xunit" ], - "time": "2015-08-24 04:09:38" + "time": "2015-09-20 12:56:44" }, { "name": "phpunit/phpunit-mock-objects", diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b9e4e67e..a9f35c36 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -192,7 +192,7 @@ class EntryController extends Controller throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); } - $form = $this->get('form.factory')->create(new EntryFilterType()); + $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser())); if ($request->query->has($form->getName())) { // manually bind values from the request diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 6cd24d44..dd316194 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -19,6 +19,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry1->setUrl('http://0.0.0.0'); $entry1->setTitle('test title entry1'); $entry1->setContent('This is my content /o/'); + $entry1->setLanguage('en'); $manager->persist($entry1); @@ -28,6 +29,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry2->setUrl('http://0.0.0.0'); $entry2->setTitle('test title entry2'); $entry2->setContent('This is my content /o/'); + $entry2->setLanguage('fr'); $manager->persist($entry2); @@ -37,6 +39,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry3->setUrl('http://0.0.0.0'); $entry3->setTitle('test title entry3'); $entry3->setContent('This is my content /o/'); + $entry3->setLanguage('en'); $tag1 = new Tag($this->getReference('bob-user')); $tag1->setLabel('foo'); @@ -54,6 +57,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry4->setUrl('http://0.0.0.0'); $entry4->setTitle('test title entry4'); $entry4->setContent('This is my content /o/'); + $entry4->setLanguage('en'); $tag1 = new Tag($this->getReference('admin-user')); $tag1->setLabel('foo'); @@ -72,6 +76,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry5->setTitle('test title entry5'); $entry5->setContent('This is my content /o/'); $entry5->setStarred(true); + $entry5->setLanguage('fr'); $manager->persist($entry5); @@ -82,6 +87,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry6->setTitle('test title entry6'); $entry6->setContent('This is my content /o/'); $entry6->setArchived(true); + $entry6->setLanguage('de'); $manager->persist($entry6); diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 024486e6..f40c1c2d 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -6,9 +6,26 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; +use Doctrine\ORM\EntityRepository; +use Wallabag\CoreBundle\Entity\User; class EntryFilterType extends AbstractType { + private $user; + private $repository; + + /** + * Repository & user are used to get a list of language entries for this user + * + * @param EntityRepository $entryRepository + * @param User $user + */ + public function __construct(EntityRepository $entryRepository, User $user) + { + $this->repository = $entryRepository; + $this->user = $user; + } + public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -53,7 +70,11 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, - )); + )) + ->add('language', 'filter_choice', array( + 'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()), + )) + ; } public function getName() diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index e764e8f7..87b9befe 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -134,4 +134,31 @@ class EntryRepository extends EntityRepository return $qb->getQuery()->getResult(); } + + /** + * Find distinct language for a given user. + * Used to build the filter language list. + * + * @param int $userId User id + * + * @return array + */ + public function findDistinctLanguageByUser($userId) + { + $results = $this->createQueryBuilder('e') + ->select('e.language') + ->where('e.user = :userId')->setParameter('userId', $userId) + ->andWhere('e.language IS NOT NULL') + ->groupBy('e.language') + ->orderBy('e.language', ' ASC') + ->getQuery() + ->getResult(); + + $languages = array(); + foreach ($results as $result) { + $languages[$result['language']] = $result['language']; + } + + return $languages; + } } diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index 176290e4..08f3fe60 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig @@ -71,6 +71,14 @@ + +
+ +
+ {{ form_widget(form.language) }} +
+
+
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 c2157db5..dcdf7c09 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 @@ -121,14 +121,12 @@
-
- {{ form_widget(form.isArchived) }} - +
+
-
- {{ form_widget(form.isStarred) }} - +
+ {{ form_widget(form.language) }}
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index 77b57884..cbd84a97 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php @@ -382,4 +382,27 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form); $this->assertCount(1, $crawler->filter('div[class=entry]')); } + + public function testFilterOnLanguage() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/unread/list'); + $form = $crawler->filter('button[id=submit-filter]')->form(); + $data = array( + 'entry_filter[language]' => 'de', + ); + + $crawler = $client->submit($form, $data); + $this->assertCount(1, $crawler->filter('div[class=entry]')); + + $form = $crawler->filter('button[id=submit-filter]')->form(); + $data = array( + 'entry_filter[language]' => 'en', + ); + + $crawler = $client->submit($form, $data); + $this->assertCount(2, $crawler->filter('div[class=entry]')); + } } -- cgit v1.2.3