public function __construct() { parent::__construct(); $this->clear(); $storage = StorageManager::instance('mongodb', 'app_test'); $this->bus = new EventBus(); $this->repository = new TicketRepository($storage, $this->bus); }
public function __construct() { parent::__construct(); $eventBus = new BusProxy(new EventBus()); $eventBus->setGate(new Gate()); $this->snapshot = SnapshotManager::instance('mongodb', 'snapshot_test'); $this->snapshot->setSnapshotPeriodical(2); $this->storage = StorageManager::instance('mongodb', 'app_test'); $this->storage->attachSnapshot($this->snapshot); $this->repository = new TicketRepository($this->storage, $eventBus); $this->clear(); }
public function __construct() { parent::__construct(); $this->storage = StorageManager::instance('mongodb', 'app_test'); $this->clear(); }
/** * Build event store. * * @param array $config * * @return StorageInterface */ private function buildEventStore(array $config) { return function () use($config) { return EventStoreManager::instance($config['engine'], $config['database'], $config['host'], $config['username'], $config['password'], $config['port']); }; }