Event.php 719 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Support\Testing\Fakes\EventFake;
  5. /**
  6. * @see \Illuminate\Events\Dispatcher
  7. */
  8. class Event extends Facade
  9. {
  10. /**
  11. * Replace the bound instance with a fake.
  12. *
  13. * @param array|string $eventsToFake
  14. * @return void
  15. */
  16. public static function fake($eventsToFake = [])
  17. {
  18. static::swap($fake = new EventFake(static::getFacadeRoot(), $eventsToFake));
  19. Model::setEventDispatcher($fake);
  20. }
  21. /**
  22. * Get the registered name of the component.
  23. *
  24. * @return string
  25. */
  26. protected static function getFacadeAccessor()
  27. {
  28. return 'events';
  29. }
  30. }