Sort of. You not testing whether your app is actually using the custom provider. I would do this in stead.
protected function getProvider(): \App\Providers\Auth\EloquentUserProvider
{
/** @var \App\Providers\Auth\EloquentUserProvider $provider */
$provider = Auth::createUserProvider('users');
return $provider;
}
When static analysis tools infer the wrong type, you can always use phpdoc like this to help them.