Skip to content

Commit cffbd5e

Browse files
committed
minor #8861 Added tip to require browser-kit in WebTestCase. (Rubinum, Tim Jabs)
This PR was merged into the 4.0 branch. Discussion ---------- Added tip to require browser-kit in WebTestCase. Hello, I played around with the WebTestCase in Symfony 4+ and I came across that fact, that you have to require the browser-kit component to use the WebTestCase class. For people who don't know the internals of symfony, it can be hard to figure out what to do now, because all they got is this error message: ``` php bin/phpunit tests #!/usr/bin/env php PHPUnit 6.5.3 by Sebastian Bergmann and contributors. Testing tests PHP Fatal error: Class 'Symfony\Component\BrowserKit\Client' not found in /media/tim/996cb512-7026-4e7a-8f4b-f2f38c02939f/tim/PhpstormProjects/symfony4TestRoutes/vendor/symfony/http-kernel/Client.php on line 31 ``` With the new flex system, this could be confusing for some developers, that they have to require additional packages. It think it is good to mention that in the docs. If I missed something here or if you think that the browser-kit should be required by the packages which provides `ẀebTestCase` and it is a WIP thing, then let me know that. Commits ------- 9ae575b Moved tip block to headline. Changed tip description. dcf2265 Changed spelling b266c1b Added tip to require browser-kit in WebTestCase.
2 parents 887dec9 + 9ae575b commit cffbd5e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ tests as far as PHPUnit is concerned, but they have a very specific workflow:
129129
Your First Functional Test
130130
~~~~~~~~~~~~~~~~~~~~~~~~~~
131131

132+
First, install the BrowserKit component in your project:
133+
134+
.. code-block:: terminal
135+
136+
$ composer require --dev browser-kit
137+
132138
Functional tests are simple PHP files that typically live in the ``tests/Controller``
133139
directory for your bundle. If you want to test the pages handled by your
134140
``PostController`` class, start by creating a new ``PostControllerTest.php``

0 commit comments

Comments
 (0)