@@ -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
@@ -883,7 +886,7 @@ Crawler Assertions
883
886
equal the expected value.
884
887
``assertCheckboxChecked(string $fieldName, string $message = '') ``/``assertCheckboxNotChecked(string $fieldName, string $message = '') ``
885
888
Asserts that the checkbox with the given name is (not) checked.
886
- ``assertFormValue(string $formSelector, string $fieldName, string $value, string $message = '') `` and ``assertNoFormValue(string $formSelector, string $fieldName, string $message = '') ``
889
+ ``assertFormValue(string $formSelector, string $fieldName, string $value, string $message = '') ``/ ``assertNoFormValue(string $formSelector, string $fieldName, string $message = '') ``
887
890
Asserts that value of the field of the first form matching the given
888
891
selector does (not) equal the expected value.
889
892
@@ -938,73 +941,6 @@ Mailer Assertions
938
941
* testing javascript
939
942
* UX or form collections as example?
940
943
941
- PHPUnit Configuration
942
- ---------------------
943
-
944
- Each application has its own PHPUnit configuration, stored in the
945
- ``phpunit.xml.dist `` file. You can edit this file to change the defaults or
946
- create a ``phpunit.xml `` file to set up a configuration for your local machine
947
- only.
948
-
949
- .. tip ::
950
-
951
- Store the ``phpunit.xml.dist `` file in your code repository and ignore
952
- the ``phpunit.xml `` file.
953
-
954
- By default, only the tests stored in ``tests/ `` are run via the ``phpunit `` command,
955
- as configured in the ``phpunit.xml.dist `` file:
956
-
957
- .. code-block :: xml
958
-
959
- <!-- phpunit.xml.dist -->
960
- <phpunit >
961
- <!-- ... -->
962
- <testsuites >
963
- <testsuite name =" Project Test Suite" >
964
- <directory >tests</directory >
965
- </testsuite >
966
- </testsuites >
967
- <!-- ... -->
968
- </phpunit >
969
-
970
- But you can add more directories. For instance, the following
971
- configuration adds tests from a custom ``lib/tests `` directory:
972
-
973
- .. code-block :: xml
974
-
975
- <!-- phpunit.xml.dist -->
976
- <phpunit >
977
- <!-- ... -->
978
- <testsuites >
979
- <testsuite name =" Project Test Suite" >
980
- <!-- ... -->
981
- <directory >lib/tests</directory >
982
- </testsuite >
983
- </testsuites >
984
- <!-- ... -->
985
- </phpunit >
986
-
987
- To include other directories in the `code coverage analysis `_, also edit the
988
- ``<filter> `` section:
989
-
990
- .. code-block :: xml
991
-
992
- <!-- phpunit.xml.dist -->
993
- <phpunit >
994
- <!-- ... -->
995
- <filter >
996
- <whitelist >
997
- <!-- ... -->
998
- <directory >lib</directory >
999
- <exclude >
1000
- <!-- ... -->
1001
- <directory >lib/tests</directory >
1002
- </exclude >
1003
- </whitelist >
1004
- </filter >
1005
- <!-- ... -->
1006
- </phpunit >
1007
-
1008
944
Learn more
1009
945
----------
1010
946
@@ -1019,11 +955,11 @@ Learn more
1019
955
.. _`PHPUnit` : https://phpunit.de/
1020
956
.. _`documentation` : https://phpunit.readthedocs.io/
1021
957
.. _`Writing Tests for PHPUnit` : https://phpunit.readthedocs.io/en/stable/writing-tests-for-phpunit.html
958
+ .. _`PHPUnit documentation` : https://phpunit.readthedocs.io/en/stable/configuration.html
1022
959
.. _`unit test` : https://en.wikipedia.org/wiki/Unit_testing
1023
960
.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
1024
961
.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1025
962
.. _`SymfonyMakerBundle` : https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
1026
963
.. _`symfony/panther` : https://github.com/symfony/panther
1027
964
.. _`PHPUnit Assertion` : https://phpunit.readthedocs.io/en/stable/assertions.html
1028
- .. _`code coverage analysis` : https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html
1029
965
.. _`section 4.1.18 of RFC 3875` : https://tools.ietf.org/html/rfc3875#section-4.1.18
0 commit comments