public function testSetEventDispatcher() { $config = new Configuration(array('event_dispatcher' => array('Malocher\\EventStoreTest\\Coverage\\Mock\\MockedEventDispatcher' => array()))); $eventDispatcher = new EventDispatcher(); $config->setEventDispatcher($eventDispatcher); //Ignore array config and return manually set EventDispatcher $this->assertSame($eventDispatcher, $config->getEventDispatcher()); }
/** * Construct * * @param Configuration $config */ public function __construct(Configuration $config) { $this->adapter = $config->getAdapter(); $this->lookupSnapshots = $config->isSnapshotLookup(); $this->autoGenerateSnapshots = $config->isAutoGenerateSnapshots(); $this->snapshotInterval = $config->getSnapshotInterval(); $this->repositoryMap = $config->getRepositoryMap(); $this->eventDispatcher = $config->getEventDispatcher(); if ($this->autoGenerateSnapshots) { $this->lookupSnapshots = true; } }