public function testFindIdentitiesWillReturnAllIds() { $collection = $this->getCollection(); $collection->expects(self::once())->method('distinct')->will(self::returnValue(new ArrayIterator(['a']))); $storage = new MongoDbEventStorage($collection, 'identity'); $storage->append(EventDescriptor::record('a', 'foo', 'bar', 1)); self::assertEquals(['a'], $storage->findIdentities()); }
/** * @param Uuid $aggregateId * @param Event $event */ private function saveEvent(Uuid $aggregateId, Event $event) { $eventData = EventDescriptor::record($aggregateId->getValue(), $event->getEventName(), $this->serializer->serialize($event, 'json'), $event->getVersion()); $this->storage->append($eventData); }
public function testFindIdentitiesWillReturnAllIds() { $storage = new MemoryEventStorage(); $storage->append(EventDescriptor::record('a', 'foo', 'bar', 1)); self::assertEquals(['a'], $storage->findIdentities()); }