To test authorize you'd want to test a policy (or a relevant class) instead.
i.e.
class MyPolicy
{
public function insert(User $user) {
// ...
}
}
You can unit test a policy by mocking model data, no need for DB connection.
i.e.
public function testInsertPermission()
{
// initiate a model with dummy data
$dummyData = ['name' => 'Joe Doe'];
$mockedUser = new User($dummyData);
// or just mock it
$mockedUser = Mockery::mock(User::class);
$mockedUser...
$actual = app(MyPolicy::class)->insert($mockedUser);
$this->assertEquals(true, $actual);
}
Then, when unit testing the form request you'd want to check that the policy within authorized was called, i.e.
$this->mock(MyPolicy::class, function (MockInterface $mock) {
$mock->shouldReceive('insert')->once();
});
You can also perform the same logic within FormRequest without a need for a separate class, but it may look untidy from the architecture point of view.