Level 41
I have just finished reading the source code for the Illuminate\Support\Facades\Event::fake() method, and that is about right. You cannot do that anymore.
I would do something like this:
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
Illuminate\Support\Facades\Event;
class TestCase extends BaseTestCase
{
protected $defaultEventsToFake = [EventA::class];
protected function fakeEvents(array $eventsToFake = [])
{
Event::fake(
array_merge($this->defaultEventsToFake, $eventsToFake)
);
}
}
1 like