shouldReceive('app') ->with(SocialiteWasCalled::class) ->once() ->andReturn($socialiteWasCalledMock); self::$functions ->shouldReceive('event') ->with($socialiteWasCalledMock) ->once(); $serviceProvider = new ServiceProvider($this->appMockWithBooted()); $serviceProvider->boot(); $this->assertTrue(true); } } namespace SocialiteProviders\Manager; use SocialiteProviders\Manager\Test\ServiceProviderTest; function app($make) { return ServiceProviderTest::$functions->app($make); } function event($event) { return ServiceProviderTest::$functions->event($event); }