protected function setUp() { include __DIR__ . '/../../../Fixtures/reverse/mysql/build/conf/reverse-bookstore-conf.php'; $this->con = Propel::getConnection('reverse-bookstore'); $this->parser = new MysqlSchemaParser($this->con); $this->platform = new MysqlPlatform(); $this->parser->setGeneratorConfig(new QuickGeneratorConfig()); $this->parser->setPlatform($this->platform); parent::setUp(); }
protected function setUp() { $config = sprintf('%s-conf.php', $this->databaseName); $path = 'reverse-bookstore' === $this->databaseName ? 'reverse/mysql' : $this->databaseName; include __DIR__ . '/../../../Fixtures/' . $path . '/build/conf/' . $config; $this->con = Propel::getConnection($this->databaseName); $this->parser = $this->getParser($this->con); $this->platform = $this->getPlatform(); $this->parser->setGeneratorConfig(new QuickGeneratorConfig()); $this->parser->setPlatform($this->platform); parent::setUp(); }
public function testParse() { $parser = new MysqlSchemaParser(Propel::getServiceContainer()->getConnection('reverse-bookstore')); $parser->setGeneratorConfig(new QuickGeneratorConfig()); $database = new Database(); $database->setPlatform(new DefaultPlatform()); $this->assertEquals(1, $parser->parse($database), 'One table and one view defined should return one as we exclude views'); $tables = $database->getTables(); $this->assertEquals(1, count($tables)); $table = $tables[0]; $this->assertEquals('Book', $table->getPhpName()); $this->assertEquals(4, count($table->getColumns())); }