@@ -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
@@ -932,7 +935,7 @@ Crawler Assertions
932
935
equal the expected value.
933
936
``assertCheckboxChecked(string $fieldName, string $message = '') ``/``assertCheckboxNotChecked(string $fieldName, string $message = '') ``
934
937
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 = '') ``
936
939
Asserts that value of the field of the first form matching the given
937
940
selector does (not) equal the expected value.
938
941
@@ -987,73 +990,6 @@ Mailer Assertions
987
990
* testing javascript
988
991
* UX or form collections as example?
989
992
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
-
1057
993
Learn more
1058
994
----------
1059
995
@@ -1068,11 +1004,11 @@ Learn more
1068
1004
.. _`PHPUnit` : https://phpunit.de/
1069
1005
.. _`documentation` : https://phpunit.readthedocs.io/
1070
1006
.. _`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
1071
1008
.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
1072
1009
.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
1073
1010
.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1074
1011
.. _`SymfonyMakerBundle` : https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
1075
1012
.. _`symfony/panther` : https://github.com/symfony/panther
1076
1013
.. _`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
1078
1014
.. _`section 4.1.18 of RFC 3875` : https://tools.ietf.org/html/rfc3875#section-4.1.18
0 commit comments