public function testSuggestingPreventActionWithMessage() { $event = new Event('test.event1'); EventManager::register('test.event1', function (Event $event) { $event->preventAction(true, 'Reason why should prevent.'); }); $event->trigger(); $this->assertTrue($event->shouldPreventAction()); $this->assertEquals('Reason why should prevent.', $event->preventActionMessage()); }