getUser('admin'); // simulate $testUser being logged in $client->loginUser($admin); $client->request('GET', '/account/edit'); $this->assertResponseIsSuccessful(); $client->submitForm('Update profile', [ 'profile[firstname]' => 'admin firstname', ]); $this->assertResponseRedirects('/account/home'); $client->request('GET', '/account/edit'); $this->assertStringContainsString('admin firstname', $client->getResponse()->getContent()); } }