The method withAccessToken() does not exist on Illuminate\Contracts\Auth\Authenticatable. It seems like you code against a sub-type of Illuminate\Contracts\Auth\Authenticatable such as Illuminate\Foundation\Auth\User.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
36
$user->/** @scrutinizer ignore-call */
37
withAccessToken($token);
Loading history...
37
38
7
$guard = AuthConfigHelper::getUserGuard($user);
39
40
7
app('auth')->guard($guard)->setUser($user);
41
42
7
app('auth')->shouldUse($guard);
43
7
}
44
45
/**
46
* If running unit test and try authenticate an user with actingAs($user)
47
* check the guards on request to authenticate or not the user.