protected function setUp()
{
$connection = new Connection();
$eventStoreOptions = new DoctrineMongoDBStorageOptions('palya-test-events');
$snapshotStorageOptions = new DoctrineMongoDBStorageOptions('palya-test-snapshots');
// set up a clean state by deleting the database
$connection->dropDatabase($eventStoreOptions->getDatabase());
$connection->dropDatabase($snapshotStorageOptions->getDatabase());
$serializer = SerializerBuilder::create()->configureHandlers(function (HandlerRegistry $registry) {
$registry->registerSubscribingHandler(new UuidHandler());
})->build();
$this->eventStore = new EventStore(new DoctrineMongoDBEventStorage($connection, $eventStoreOptions, $serializer), new NullBus(), new InMemoryIdentityMap());
$snapshotStorage = new DoctrineMongoDBSnapshotStorage($connection, $eventStoreOptions, $serializer);
$this->customerRepository = new CustomerRepository($this->eventStore);
$this->customerSnapshotRepository = new CustomerSnapshotRepository($this->eventStore, $snapshotStorage);
}