Compatibility with Symfony 4.3.0-BETA1
gnutix opened this issue · comments
Running any test extending Liip\FunctionalTestBundle\Test\WebTestCase
result in :
TypeError: Return value of Liip\FunctionalTestBundle\Test\WebTestCase::makeClient()
must be an instance of Symfony\Bundle\FrameworkBundle\Client, instance of
Symfony\Bundle\FrameworkBundle\KernelBrowser returned
/srv/app/vendor/liip/functional-test-bundle/src/Test/WebTestCase.php:413
Preconditions
- Symfony 4.3.0-BETA1
- LiipFunctionalTestBundle 2.0.0-alpha15 and 3.0.0-alpha1
I've fixed the code with this patch : https://diffy.org/diff/ydi0ltz330f1n73szx1xajor
But I'm not sure if I can do a PR, as it's a BC break for this library I guess.
Thanks, could you please open a PR targeting the 3.x
branch? We'll see if it breaks tests.
There you go : #510
KernelBrowser
was added in Symfony 4.3, so it won't work with the current test settings (Symfony 4.1).
Thanks for the PR, it fixed the issue for Symfony 4.3 but break tests with all other versions.
I'm still wondering if this is an issue from Symfony that require a change to avoid BC break, see these related issues: symfony/symfony#30541 symfony/symfony#31039 symfony/symfony#31040
We could use an alias as shown in this comment: symfony/symfony#30541 (comment)
I managed to get my projects' tests running by adding :
class_alias('Symfony\Bundle\FrameworkBundle\KernelBrowser', 'Symfony\Bundle\FrameworkBundle\Client');
On top of Liip\FunctionalTestBundle\Test\WebTestCase
. Let me make a PR and see how the tests handle it in different versions of Symfony.
Edit: see #512
PR ready.
Thanks a lot! I'll publish a new release.