public function testExceptionsCanBeSetOnEventOnlyIfEventIsTriggered() { $event = new Event(); $this->expectsException(function () use($event) { $event->setException('callback', new \Exception('test')); }, Exception::class, null, Exception::EVENT_IS_NOT_TRIGGERED_YET); }