Skip to content

Commit

Permalink
Fixing test for postgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Dec 14, 2012
1 parent 36ecd66 commit 6c54a87
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL371Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,29 @@ protected function setUp()
{
parent::setUp();

if ($this->_conn->getSchemaManager()->tablesExist('dbal371')) {
$this->_conn->executeQuery('DELETE FROM dbal371');
} else {
$table = new \Doctrine\DBAL\Schema\Table('dbal371');
$table->addColumn('id', 'integer');
$table->setPrimaryKey(array('id'));

$this->_conn->getSchemaManager()->createTable($table);
if ($this->_conn->getSchemaManager()->tablesExist('DBAL371')) {
$this->_conn->getSchemaManager()->dropTable('DBAL371');
}
$table = new \Doctrine\DBAL\Schema\Table('DBAL371');
$table->addColumn('id', 'integer');
$table->setPrimaryKey(array('id'));

$this->_conn->getSchemaManager()->createTable($table);
}

/**
* @expectedException \Doctrine\DBAL\Driver\DriverException
*/
public function testException()
{
$stmt = $this->_conn->prepare('INSERT INTO dbal371 VALUES (1)');
$stmt = $this->_conn->prepare('INSERT INTO DBAL371 VALUES (1)');
$stmt->execute();
$stmt->execute();
}

public function testExceptionCode()
{
$stmt = $this->_conn->prepare('INSERT INTO dbal371 VALUES (1)');
$stmt = $this->_conn->prepare('INSERT INTO DBAL371 VALUES (1)');
$this->_conn->beginTransaction();
$stmt->execute();
try {
Expand Down

0 comments on commit 6c54a87

Please sign in to comment.