function storeEvents($assert) { $store = new MemoryEventStore(); $application = new CommandQueryApplication($store); $application->handle(new Foo2('that')); $assert($store->allEvents(), [new Fooed('that happened')]); }