@@ -34,7 +34,10 @@ PHP class ending with "Test" (e.g. ``BlogControllerTest``) that lives in
3434the ``tests/ `` directory of your application.
3535
3636PHPUnit is configured by the ``phpunit.xml.dist `` file in the root of your
37- application.
37+ application. The default configuration provided by Symfony Flex will be
38+ enough in most cases. Read the `PHPUnit documentation `_ to discover all
39+ possible configuration options (e.g. to enable code coverage or to split
40+ your test into multiple "test suites").
3841
3942.. note ::
4043
@@ -932,7 +935,7 @@ Crawler Assertions
932935 equal the expected value.
933936``assertCheckboxChecked(string $fieldName, string $message = '') ``/``assertCheckboxNotChecked(string $fieldName, string $message = '') ``
934937 Asserts that the checkbox with the given name is (not) checked.
935- ``assertFormValue(string $formSelector, string $fieldName, string $value, string $message = '') `` and ``assertNoFormValue(string $formSelector, string $fieldName, string $message = '') ``
938+ ``assertFormValue(string $formSelector, string $fieldName, string $value, string $message = '') ``/ ``assertNoFormValue(string $formSelector, string $fieldName, string $message = '') ``
936939 Asserts that value of the field of the first form matching the given
937940 selector does (not) equal the expected value.
938941
@@ -987,73 +990,6 @@ Mailer Assertions
987990 * testing javascript
988991 * UX or form collections as example?
989992
990- PHPUnit Configuration
991- ---------------------
992-
993- Each application has its own PHPUnit configuration, stored in the
994- ``phpunit.xml.dist `` file. You can edit this file to change the defaults or
995- create a ``phpunit.xml `` file to set up a configuration for your local machine
996- only.
997-
998- .. tip ::
999-
1000- Store the ``phpunit.xml.dist `` file in your code repository and ignore
1001- the ``phpunit.xml `` file.
1002-
1003- By default, only the tests stored in ``tests/ `` are run via the ``phpunit `` command,
1004- as configured in the ``phpunit.xml.dist `` file:
1005-
1006- .. code-block :: xml
1007-
1008- <!-- phpunit.xml.dist -->
1009- <phpunit >
1010- <!-- ... -->
1011- <testsuites >
1012- <testsuite name =" Project Test Suite" >
1013- <directory >tests</directory >
1014- </testsuite >
1015- </testsuites >
1016- <!-- ... -->
1017- </phpunit >
1018-
1019- But you can add more directories. For instance, the following
1020- configuration adds tests from a custom ``lib/tests `` directory:
1021-
1022- .. code-block :: xml
1023-
1024- <!-- phpunit.xml.dist -->
1025- <phpunit >
1026- <!-- ... -->
1027- <testsuites >
1028- <testsuite name =" Project Test Suite" >
1029- <!-- ... -->
1030- <directory >lib/tests</directory >
1031- </testsuite >
1032- </testsuites >
1033- <!-- ... -->
1034- </phpunit >
1035-
1036- To include other directories in the `code coverage analysis `_, also edit the
1037- ``<filter> `` section:
1038-
1039- .. code-block :: xml
1040-
1041- <!-- phpunit.xml.dist -->
1042- <phpunit >
1043- <!-- ... -->
1044- <filter >
1045- <whitelist >
1046- <!-- ... -->
1047- <directory >lib</directory >
1048- <exclude >
1049- <!-- ... -->
1050- <directory >lib/tests</directory >
1051- </exclude >
1052- </whitelist >
1053- </filter >
1054- <!-- ... -->
1055- </phpunit >
1056-
1057993 Learn more
1058994----------
1059995
@@ -1068,11 +1004,11 @@ Learn more
10681004.. _`PHPUnit` : https://phpunit.de/
10691005.. _`documentation` : https://phpunit.readthedocs.io/
10701006.. _`Writing Tests for PHPUnit` : https://phpunit.readthedocs.io/en/stable/writing-tests-for-phpunit.html
1007+ .. _`PHPUnit documentation` : https://phpunit.readthedocs.io/en/stable/configuration.html
10711008.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
10721009.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
10731010.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
10741011.. _`SymfonyMakerBundle` : https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
10751012.. _`symfony/panther` : https://github.com/symfony/panther
10761013.. _`PHPUnit Assertion` : https://phpunit.readthedocs.io/en/stable/assertions.html
1077- .. _`code coverage analysis` : https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html
10781014.. _`section 4.1.18 of RFC 3875` : https://tools.ietf.org/html/rfc3875#section-4.1.18
0 commit comments