Skip to content

Commit 90754dd

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Minor typo fix Remove docs on PHPUnit configuration
2 parents 10c4ed4 + 649dd43 commit 90754dd

File tree

1 file changed

+6
-70
lines changed

1 file changed

+6
-70
lines changed

testing.rst

Lines changed: 6 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ PHP class ending with "Test" (e.g. ``BlogControllerTest``) that lives in
3434
the ``tests/`` directory of your application.
3535

3636
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").
3841

3942
.. note::
4043

@@ -883,7 +886,7 @@ Crawler Assertions
883886
equal the expected value.
884887
``assertCheckboxChecked(string $fieldName, string $message = '')``/``assertCheckboxNotChecked(string $fieldName, string $message = '')``
885888
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 = '')``
887890
Asserts that value of the field of the first form matching the given
888891
selector does (not) equal the expected value.
889892

@@ -938,73 +941,6 @@ Mailer Assertions
938941
* testing javascript
939942
* UX or form collections as example?
940943
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-
1008944
Learn more
1009945
----------
1010946

@@ -1019,11 +955,11 @@ Learn more
1019955
.. _`PHPUnit`: https://phpunit.de/
1020956
.. _`documentation`: https://phpunit.readthedocs.io/
1021957
.. _`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
1022959
.. _`unit test`: https://en.wikipedia.org/wiki/Unit_testing
1023960
.. _`DAMADoctrineTestBundle`: https://github.com/dmaicher/doctrine-test-bundle
1024961
.. _`DoctrineFixturesBundle documentation`: https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1025962
.. _`SymfonyMakerBundle`: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
1026963
.. _`symfony/panther`: https://github.com/symfony/panther
1027964
.. _`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
1029965
.. _`section 4.1.18 of RFC 3875`: https://tools.ietf.org/html/rfc3875#section-4.1.18

0 commit comments

Comments
 (0)