Commit b37ff7e9 authored by Benjamin Eberlei's avatar Benjamin Eberlei

A new temporary table test refactoring (if i could reproduce it locally...)

parent 9e757030
......@@ -20,11 +20,11 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function tearDown()
{
if ($this->_conn) {
try {
$tempTable = $this->_conn->getDatabasePlatform()->getTemporaryTableName("temporary");
$this->_conn->exec($this->_conn->getDatabasePlatform()->getDropTemporaryTableSQL($tempTable));
} catch(\Exception $e) {
} catch(\Exception $e) { }
}
}
......@@ -46,15 +46,11 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn("id", "integer");
$table->setPrimaryKey(array('id'));
$this->_conn->beginTransaction();
$this->_conn->getSchemaManager()->createTable($table);
$this->_conn->commit();
foreach ($platform->getCreateTableSQL($table) AS $sql) {
$this->_conn->executeQuery($sql);
}
$this->_conn->beginTransaction();
$table = $this->_conn->getSchemaManager()->listTableDetails($table->getName());
$this->assertEquals("nontemporary", $table->getName());
$this->_conn->insert("nontemporary", array("id" => 1));
$this->_conn->exec($platform->getDropTemporaryTableSQL($tempTable));
$this->_conn->insert("nontemporary", array("id" => 2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment