// Plain PHP
public function testEventFiresOnCreate(): void {
$eventFired = false;
$dispatcher = new EventDispatcher();
$dispatcher->listen(PostCreated::class, function() use (&$eventFired) {
$eventFired = true;
});
$service = new PostService($dispatcher);
$service->create(["title"=>"Hello","body"=>"World"]);
$this->assertTrue($eventFired);
}