function projectEvents($assert) { $store = new MemoryEventStore(); $application = new CommandQueryApplication($store); $store->append(new Fooed5('that happened'), 'foo'); $bar = $application->handle(new Bar()); $assert($bar->fooed, ['So that happened']); }