diff --git a/form/unit_testing.rst b/form/unit_testing.rst index 0cff565be00..ddaf5816fcf 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -240,4 +240,18 @@ guessers using the :method:`Symfony\\Component\\Form\\Test\\FormIntegrationTestC and :method:`Symfony\\Component\\Form\\Test\\FormIntegrationTestCase::getTypeGuessers` methods. +If you want to test the themes of your forms, you may want to make your test extends the +:class:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase` class. This saves a lot of +boilerplate and code duplication by implementing the +:class:`Symfony\\Component\\Form\\Test\\FormIntegrationTestCase` methods for you. +All that's left to do is to implement the +:method:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase::getTemplatePaths`, the +:method:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase::getTwigExtensions` and +the :method:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase::getThemes` methods. + +.. versionadded:: 6.4 + + The :class:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase` class was + introduced in Symfony 6.4. + .. _`PHPUnit data providers`: https://docs.phpunit.de/en/9.6/writing-tests-for-phpunit.html#data-providers
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: