Skip to content

Instantly share code, notes, and snippets.

@lauroguedes
Created March 9, 2021 18:33
Show Gist options
  • Select an option

  • Save lauroguedes/0ac942755c8c7a8ccefe9666cdf51f5c to your computer and use it in GitHub Desktop.

Select an option

Save lauroguedes/0ac942755c8c7a8ccefe9666cdf51f5c to your computer and use it in GitHub Desktop.
Mocking SociaLite Provider
protected function mockSocialiteFacade(array $dados, string $driver, string $method)
{
$provider = $this->mock(Laravel\Socialite\Contracts\Provider::class, function ($mock) use ($dados, $method) {
return $mock->shouldReceive($method)
->andReturn((object) $dados);
});
\Socialite::shouldReceive('driver')
->with($driver)
->andReturn($provider);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment