@@ -34,7 +34,10 @@ PHP class ending with "Test" (e.g. ``BlogControllerTest``) that lives in
34
34
the ``tests/ `` directory of your application.
35
35
36
36
PHPUnit 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").
38
41
39
42
.. note ::
40
43
@@ -931,73 +934,6 @@ Mailer Assertions
931
934
* testing javascript
932
935
* UX or form collections as example?
933
936
934
- PHPUnit Configuration
935
- ---------------------
936
-
937
- Each application has its own PHPUnit configuration, stored in the
938
- ``phpunit.xml.dist `` file. You can edit this file to change the defaults or
939
- create a ``phpunit.xml `` file to set up a configuration for your local machine
940
- only.
941
-
942
- .. tip ::
943
-
944
- Store the ``phpunit.xml.dist `` file in your code repository and ignore
945
- the ``phpunit.xml `` file.
946
-
947
- By default, only the tests stored in ``tests/ `` are run via the ``phpunit `` command,
948
- as configured in the ``phpunit.xml.dist `` file:
949
-
950
- .. code-block :: xml
951
-
952
- <!-- phpunit.xml.dist -->
953
- <phpunit >
954
- <!-- ... -->
955
- <testsuites >
956
- <testsuite name =" Project Test Suite" >
957
- <directory >tests</directory >
958
- </testsuite >
959
- </testsuites >
960
- <!-- ... -->
961
- </phpunit >
962
-
963
- But you can add more directories. For instance, the following
964
- configuration adds tests from a custom ``lib/tests `` directory:
965
-
966
- .. code-block :: xml
967
-
968
- <!-- phpunit.xml.dist -->
969
- <phpunit >
970
- <!-- ... -->
971
- <testsuites >
972
- <testsuite name =" Project Test Suite" >
973
- <!-- ... -->
974
- <directory >lib/tests</directory >
975
- </testsuite >
976
- </testsuites >
977
- <!-- ... -->
978
- </phpunit >
979
-
980
- To include other directories in the `code coverage analysis `_, also edit the
981
- ``<filter> `` section:
982
-
983
- .. code-block :: xml
984
-
985
- <!-- phpunit.xml.dist -->
986
- <phpunit >
987
- <!-- ... -->
988
- <filter >
989
- <whitelist >
990
- <!-- ... -->
991
- <directory >lib</directory >
992
- <exclude >
993
- <!-- ... -->
994
- <directory >lib/tests</directory >
995
- </exclude >
996
- </whitelist >
997
- </filter >
998
- <!-- ... -->
999
- </phpunit >
1000
-
1001
937
Learn more
1002
938
----------
1003
939
@@ -1012,11 +948,11 @@ Learn more
1012
948
.. _`PHPUnit` : https://phpunit.de/
1013
949
.. _`documentation` : https://phpunit.readthedocs.io/
1014
950
.. _`Writing Tests for PHPUnit` : https://phpunit.readthedocs.io/en/stable/writing-tests-for-phpunit.html
951
+ .. _`PHPUnit documentation` : https://phpunit.readthedocs.io/en/stable/configuration.html
1015
952
.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
1016
953
.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
1017
954
.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1018
955
.. _`SymfonyMakerBundle` : https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
1019
956
.. _`symfony/panther` : https://github.com/symfony/panther
1020
957
.. _`PHPUnit Assertion` : https://phpunit.readthedocs.io/en/stable/assertions.html
1021
- .. _`code coverage analysis` : https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html
1022
958
.. _`section 4.1.18 of RFC 3875` : https://tools.ietf.org/html/rfc3875#section-4.1.18
0 commit comments