コード例 #1
0
ファイル: MigrationTest.php プロジェクト: bondarovich/Propel2
 public function setUp()
 {
     parent::setUp();
     $this->connectionOption = ['migration_command=' . $this->getConnectionDsn('bookstore', true)];
     $this->connectionOption = str_replace('dbname=test', 'dbname=migration', $this->connectionOption);
     $this->inputDir = __DIR__ . '/../../../../Fixtures/migration-command';
     $this->outputDir = __DIR__ . self::$output;
 }
コード例 #2
0
 protected function setUp()
 {
     parent::setUp();
     Propel::init(__DIR__ . '/../../../../Fixtures/reverse/pgsql/build/conf/reverse-bookstore-conf.php');
     $this->con = Propel::getConnection('reverse-bookstore');
     $this->con->beginTransaction();
     if ('pgsql' !== $this->con->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
         $this->markTestSkipped('This test is designed for PostgreSQL');
     }
 }
コード例 #3
0
 /**
  * This is run before each unit test; it populates the database.
  */
 protected function setUp()
 {
     parent::setUp();
     if (true !== self::$isInitialized) {
         $file = __DIR__ . '/../../../../Fixtures/bookstore/build/conf/bookstore-conf.php';
         if (!file_exists($file)) {
             return;
         }
         Propel::init(__DIR__ . '/../../../../Fixtures/bookstore/build/conf/bookstore-conf.php');
         self::$isInitialized = true;
     }
     $this->con = Propel::getServiceContainer()->getConnection(BookTableMap::DATABASE_NAME);
     $this->con->beginTransaction();
 }
コード例 #4
0
 public function setUp()
 {
     parent::setUp();
     if (!$this->con) {
         require_once __DIR__ . '/../../../../Fixtures/migration/build/conf/migration-conf.php';
         $this->con = Propel::getConnection('migration');
         $adapterClass = Propel::getServiceContainer()->getAdapterClass('migration');
         $this->database = new Database();
         $schemaParserClass = sprintf('\\%s\\%sSchemaParser', 'Propel\\Generator\\Reverse', ucfirst($adapterClass));
         $platformClass = sprintf('\\%s\\%sPlatform', 'Propel\\Generator\\Platform', ucfirst($adapterClass));
         $this->parser = new $schemaParserClass($this->con);
         $this->platform = new $platformClass();
         $this->platform->setIdentifierQuoting(true);
         $generatorConfig = new QuickGeneratorConfig();
         $this->platform->setGeneratorConfig($generatorConfig);
         $this->parser->setGeneratorConfig(new QuickGeneratorConfig());
         $this->parser->setPlatform($this->platform);
     }
 }
コード例 #5
0
 protected function setUp()
 {
     parent::setUp();
     $this->databaseMap = Propel::getServiceContainer()->getDatabaseMap('bookstore-schemas');
 }