Exemplo n.º 1
0
 function mapIdentifierToRoot()
 {
     $application = new GenericApplication($this->store, ObjectAggregateFactory::mappedRoot([ObjectBasedSpec_FooCommand::class => new ObjectBasedSpec_FooAggregate(), ObjectBasedSpec_BarCommand::class => new ObjectBasedSpec_BarAggregate()]));
     $application->handle(new ObjectBasedSpec_FooCommand());
     $application->handle(new ObjectBasedSpec_BarCommand());
     $this->assert->equals(ObjectBasedSpec_FooAggregate::$handled, [new ObjectBasedSpec_FooCommand()]);
     $this->assert->equals(ObjectBasedSpec_BarAggregate::$handled, [new ObjectBasedSpec_BarCommand()]);
 }
Exemplo n.º 2
0
 public function __construct(EventStore $store)
 {
     parent::__construct($store, new CommandAggregateFactory(), new QueryProjectionFactory());
     $this->setCommandBaseClass(Command::class);
 }