Skip to content

Added tip to require browser-kit in WebTestCase. #8861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2017
Merged

Added tip to require browser-kit in WebTestCase. #8861

merged 3 commits into from
Dec 22, 2017

Conversation

Rubinum
Copy link
Contributor

@Rubinum Rubinum commented Dec 9, 2017

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.

testing.rst Outdated

.. tip::

  Do not forget to require the ``browser-kit`` component via ``composer require browser-kit``, if you want to use the ``WebTestCase`` class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would start the section (i.e. right under the "Your First Functional Test" headline) like this:

First, install the BrowserKit component in your project:

.. code-block:: terminal

    $ composer require --dev browser-kit

@xabbuh xabbuh added this to the 4.0 milestone Dec 11, 2017
@xabbuh
Copy link
Member

xabbuh commented Dec 22, 2017

Thank you @Rubinum.

@xabbuh xabbuh merged commit 9ae575b into symfony:4.0 Dec 22, 2017
xabbuh added a commit that referenced this pull request Dec 22, 2017
…, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants