public function setUp()
{
$this->dm = $this->getMockDocumentManager();
$cmf = new ClassMetadataFactory();
$cmf->setConfiguration($this->dm->getConfiguration());
$cmf->setDocumentManager($this->dm);
$map = array();
foreach ($cmf->getAllMetadata() as $cm) {
$this->documentCollections[$cm->name] = $this->getMockCollection();
$this->documentDatabases[$cm->name] = $this->getMockDatabase();
$this->classMetadatas[$cm->name] = $cm;
}
$this->dm->unitOfWork = $this->getMockUnitOfWork();
$this->dm->metadataFactory = $cmf;
$this->dm->documentCollections = $this->documentCollections;
$this->dm->documentDatabases = $this->documentDatabases;
$this->schemaManager = new SchemaManager($this->dm, $cmf);
$this->dm->schemaManager = $this->schemaManager;
}