diff --git a/contributing/code/tests.rst b/contributing/code/tests.rst index 060e3eda02b..f09a8446ffd 100644 --- a/contributing/code/tests.rst +++ b/contributing/code/tests.rst @@ -64,6 +64,18 @@ what's going on and if the tests are broken because of the new code. On Windows, install the `Cmder`_, `ConEmu`_, `ANSICON`_ or `Mintty`_ free applications to see colored test results. +Testing Generated Code +---------------------- + +Some tests generate code on the fly and check that it matches expected stored in +in a file. To regenerate those files, you can use the following approach, run +the tests with the environment variable ``TEST_GENERATE_FIXTURES`` set to ``1``: + +.. code-block:: terminal + + $ TEST_GENERATE_FIXTURES=1 php ./phpunit src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php + + .. _`install Composer`: https://getcomposer.org/download/ .. _Cmder: https://cmder.app/ .. _ConEmu: https://conemu.github.io/