diff --git a/src/Event.php b/src/Event.php new file mode 100644 index 0000000..32bdc69 --- /dev/null +++ b/src/Event.php @@ -0,0 +1,47 @@ +expectException(InvalidArgumentException::class); + Event::bind('badEventName', fn () => null); + + $this->expectException(InvalidArgumentException::class); + Event::fire('badEventName', []); + } + + public function testBindAndFire(): void + { + $fn = static function($value = false) { + static::assertTrue($value); + }; + Event::bind(EventType::INPUT_KEY, $fn); + Event::fire(EventType::INPUT_KEY, TRUE); + } +}