protected function setUp() { parent::setUp(); if (!static::$_setup) { static::$_setup = true; Type::addType('approx_date', 'CrEOF\\CustomTypes\\DBAL\\Types\\ApproxDateType'); Type::addType('gender', 'CrEOF\\CustomTypes\\DBAL\\Types\\GenderType'); $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(self::APPROXDATE_ENTITY), $this->_em->getClassMetadata(self::GENDER_ENTITY))); } }
protected function setUp() { parent::setUp(); if (!static::$_setup) { static::$_setup = true; $entityPaths = array(__DIR__ . '/Fixtures'); $entityNamespaces = array('CrEOF\\Doctrine\\ORM\\Mapping\\Tests\\Fixtures'); $this->_em->getConfiguration()->setNamingStrategy(new NamespaceNamingStrategy(array('trimAbstract' => true, 'entityNamespaces' => $entityNamespaces))); $this->_em->getConfiguration()->getMetadataDriverImpl()->addPaths($entityPaths); $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(self::ABSTRACT_MEDIA), $this->_em->getClassMetadata(self::KEYWORD), $this->_em->getClassMetadata(self::AUDIO), $this->_em->getClassMetadata(self::VIDEO), $this->_em->getClassMetadata(self::VINYL), $this->_em->getClassMetadata(self::COMPACT_DISC))); } }
/** * @throws UnsupportedPlatformException */ protected function setUp() { parent::setUp(); $this->conn = static::$_sharedConn; $this->platformName = $this->conn->getDatabasePlatform()->getName(); /** * Add types to DBAL and setup fixtures */ if (!static::$_setup) { static::$_setup = true; switch ($this->platformName) { case 'postgresql': $this->setUpPostgreSql(); break; case 'mysql': $this->setUpMySql(); break; default: throw UnsupportedPlatformException::unsupportedPlatform($this->platformName); break; } } /** * Add DQL functions to ORM */ $this->setupCommonFunctions(); switch ($this->platformName) { case 'postgresql': $this->setUpPostgreSqlFunctions(); break; case 'mysql': $this->setUpMySqlFunctions(); break; default: throw UnsupportedPlatformException::unsupportedPlatform($this->platformName); break; } }