Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

unlikenesses's avatar

"Your session has expired" when testing user in Spark

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?

0 likes
1 reply

Please or to participate in this conversation.