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(); }
/** * @param array $config * * @return SnapshotInterface */ private function buildSnapshot(array $config) { return function () use($config) { return SnapshotManager::instance($config['engine'], $config['database'], $config['host'], $config['username'], $config['password'], $config['port']); }; }