@@ -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
@@ -928,73 +931,6 @@ Mailer Assertions
928931 * testing javascript
929932 * UX or form collections as example?
930933
931- PHPUnit Configuration
932- ---------------------
933-
934- Each application has its own PHPUnit configuration, stored in the
935- ``phpunit.xml.dist `` file. You can edit this file to change the defaults or
936- create a ``phpunit.xml `` file to set up a configuration for your local machine
937- only.
938-
939- .. tip ::
940-
941- Store the ``phpunit.xml.dist `` file in your code repository and ignore
942- the ``phpunit.xml `` file.
943-
944- By default, only the tests stored in ``tests/ `` are run via the ``phpunit `` command,
945- as configured in the ``phpunit.xml.dist `` file:
946-
947- .. code-block :: xml
948-
949- <!-- phpunit.xml.dist -->
950- <phpunit >
951- <!-- ... -->
952- <testsuites >
953- <testsuite name =" Project Test Suite" >
954- <directory >tests</directory >
955- </testsuite >
956- </testsuites >
957- <!-- ... -->
958- </phpunit >
959-
960- But you can add more directories. For instance, the following
961- configuration adds tests from a custom ``lib/tests `` directory:
962-
963- .. code-block :: xml
964-
965- <!-- phpunit.xml.dist -->
966- <phpunit >
967- <!-- ... -->
968- <testsuites >
969- <testsuite name =" Project Test Suite" >
970- <!-- ... -->
971- <directory >lib/tests</directory >
972- </testsuite >
973- </testsuites >
974- <!-- ... -->
975- </phpunit >
976-
977- To include other directories in the `code coverage analysis `_, also edit the
978- ``<filter> `` section:
979-
980- .. code-block :: xml
981-
982- <!-- phpunit.xml.dist -->
983- <phpunit >
984- <!-- ... -->
985- <filter >
986- <whitelist >
987- <!-- ... -->
988- <directory >lib</directory >
989- <exclude >
990- <!-- ... -->
991- <directory >lib/tests</directory >
992- </exclude >
993- </whitelist >
994- </filter >
995- <!-- ... -->
996- </phpunit >
997-
998934 Learn more
999935----------
1000936
@@ -1009,11 +945,11 @@ Learn more
1009945.. _`PHPUnit` : https://phpunit.de/
1010946.. _`documentation` : https://phpunit.readthedocs.io/
1011947.. _`Writing Tests for PHPUnit` : https://phpunit.readthedocs.io/en/stable/writing-tests-for-phpunit.html
948+ .. _`PHPUnit documentation` : https://phpunit.readthedocs.io/en/stable/configuration.html
1012949.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
1013950.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
1014951.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1015952.. _`SymfonyMakerBundle` : https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
1016953.. _`symfony/panther` : https://github.com/symfony/panther
1017954.. _`PHPUnit Assertion` : https://phpunit.readthedocs.io/en/stable/assertions.html
1018- .. _`code coverage analysis` : https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html
1019955.. _`section 4.1.18 of RFC 3875` : https://tools.ietf.org/html/rfc3875#section-4.1.18
0 commit comments