ServiceProviderTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace SocialiteProviders\Manager\Test;
  3. use Mockery as m;
  4. use PHPUnit\Framework\TestCase;
  5. use SocialiteProviders\Manager\ServiceProvider;
  6. use SocialiteProviders\Manager\SocialiteWasCalled;
  7. class ServiceProviderTest extends TestCase
  8. {
  9. use ManagerTestTrait;
  10. /**
  11. * @test
  12. */
  13. public function it_fires_an_event(): void
  14. {
  15. $socialiteWasCalledMock = m::mock(SocialiteWasCalled::class);
  16. self::$functions
  17. ->shouldReceive('app')
  18. ->with(SocialiteWasCalled::class)
  19. ->once()
  20. ->andReturn($socialiteWasCalledMock);
  21. self::$functions
  22. ->shouldReceive('event')
  23. ->with($socialiteWasCalledMock)
  24. ->once();
  25. $serviceProvider = new ServiceProvider($this->appMockWithBooted());
  26. $serviceProvider->boot();
  27. $this->assertTrue(true);
  28. }
  29. }
  30. namespace SocialiteProviders\Manager;
  31. use SocialiteProviders\Manager\Test\ServiceProviderTest;
  32. function app($make)
  33. {
  34. return ServiceProviderTest::$functions->app($make);
  35. }
  36. function event($event)
  37. {
  38. return ServiceProviderTest::$functions->event($event);
  39. }