Booting a kernel before calling Symfony WebTestCase::createClient() is deprecated in Symfony 4.4 (symfony/symfony#32056). This exposed an issue with LiipTestFixturesBundle which was causing multiple kernels to be booted during a test. After fixing this in liip/LiipTestFixturesBundle#62 it was brought to my attention that Liip WebTestCase::loginAs is now broken since we require the client to be created before loading fixtures.
As a result, I think deprecating the loginAs method and adding a loginClient method is the best path forward. Note that in Symfony 5.1 we have $client->loginUser() which is very similar.
Booting a kernel before calling Symfony WebTestCase::createClient() is deprecated in Symfony 4.4 (symfony/symfony#32056). This exposed an issue with LiipTestFixturesBundle which was causing multiple kernels to be booted during a test. After fixing this in liip/LiipTestFixturesBundle#62 it was brought to my attention that Liip WebTestCase::loginAs is now broken since we require the client to be created before loading fixtures.
As a result, I think deprecating the
loginAs
method and adding aloginClient
method is the best path forward. Note that in Symfony 5.1 we have$client->loginUser()
which is very similar.I've been using a similar helper function in my projects for a couple of years now, and after suggesting it as an option on https://github.com/liip/LiipTestFixturesBundle/pull/62#issuecomment-622191412 others have reported that it works for them as well.