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();
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function attach(BusInterface $bus)
 {
     $name = $bus->getName();
     if (BusInterface::SYSTEM_BUS === $name) {
         $this->assertValidSystemBus($bus);
         $this->buses[$name] = $bus;
         return;
     }
     $this->assertNotRegisteredBus($name);
     $bus = new BusProxy($bus);
     $bus->setGate($this);
     $this->buses[$name] = $bus;
 }