Level 8
What was your solution to this?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using Laravel 5.5 & Spark, and have a simple Feature test:
$this->be(factory('App\User')->create());
$thing= factory('App\Thing')->create();
$response = $this->get('/things');
$response->assertSee($thing->title);
When I run this test with PHPUnit the test fails and the HTML output is massive, of course, but the relevant part seems to be:
<div class="modal-body">
Your session has expired. Please login again to continue.
</div>
I thought that using be (or actingAs) would allow me to test as a logged-in user. Is this something to do with Spark? How can I circumvent it?
Please or to participate in this conversation.