public function setUp() { $config = new Configuration(); $config->setMetadataDriverImpl(AnnotationDriver::create("tests/Doctrine/Tests/OXM/Entities")); $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache()); $this->metadataFactory = new ClassMetadataFactory($config); $this->marshaller = new XmlMarshaller($this->metadataFactory); }
/** * @static * @param \Doctrine\OXM\Storage\Storage|null $storage * @param \Doctrine\OXM\Configuration|null $config * @param \Doctrine\Common\EventManager|null $eventManager * @return XmlEntityManagerMock */ public static function create(\Doctrine\OXM\Storage\Storage $storage = null, \Doctrine\OXM\Configuration $config = null, \Doctrine\Common\EventManager $eventManager = null) { if (is_null($storage)) { $storage = new \Doctrine\OXM\Storage\FileSystemStorage(__DIR__ . '/../Workspace'); } if (is_null($config)) { $config = new \Doctrine\OXM\Configuration(); $config->setMetadataDriverImpl(\Doctrine\OXM\Mapping\Driver\AnnotationDriver::create(__DIR__ . '/../OXM/Entities')); } if (is_null($eventManager)) { $eventManager = new \Doctrine\Common\EventManager(); } return new XmlEntityManagerMock($storage, $config, $eventManager); }