Clash with Livewire Tests

I’ve just upgraded an app to Laravel 8 and I’m having an issue with running all of my tests. When I run them all together, about 6 of them fail, and it seems to be due to the ConvertEmptyStringsToNull middleware being ignored. However if I run the tests individually, or all the tests in the same class, they pass.

However if I include processIsolation="false" in phpunit.xml then the tests all pass.

I’ve managed to track the clash down to a simple Livewire test I had written. Just calling

Livewire::test(AdminUsersTable::class)
   ->set('search', $user->firstName)

seems to screw up the other tests. If I comment out the set method, the Livewire test fails, (as expected) but everything else passes. Also, if I get the tests to run in reverse, the pro3

Some googling has suggested that Livewire doesn’t apply the ConvertEmptyStringsToNull middleware by design. I assume it has something to do with this, but I’m not sure.

I’m ok with Livewire not using the middleware, but other sections of my app that don’t use Livewire expect it to be there. And in practice, it is there, just not in testing.

Does anyone know of a way I can work around this issue and get all my tests to pass? I really don’t want to have to use processIsolation. And weirdly I didn’t have this issue in Laravel 7, so I’m not sure what the change was in Laravel 8 that caused it.

I’m using version 2.4.0 of livewire.

Any help would be really appreciated.