Commit c880b19e authored by Tobias Schultze's avatar Tobias Schultze

add unit tests for deadlock errors

parent 224b76e1
...@@ -24,6 +24,8 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -24,6 +24,8 @@ abstract class AbstractDriverTest extends DbalTestCase
const EXCEPTION_TABLE_EXISTS = 'Doctrine\DBAL\Exception\TableExistsException'; const EXCEPTION_TABLE_EXISTS = 'Doctrine\DBAL\Exception\TableExistsException';
const EXCEPTION_TABLE_NOT_FOUND = 'Doctrine\DBAL\Exception\TableNotFoundException'; const EXCEPTION_TABLE_NOT_FOUND = 'Doctrine\DBAL\Exception\TableNotFoundException';
const EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION = 'Doctrine\DBAL\Exception\UniqueConstraintViolationException'; const EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION = 'Doctrine\DBAL\Exception\UniqueConstraintViolationException';
const EXCEPTION_DEADLOCK = 'Doctrine\DBAL\Exception\DeadlockException';
const EXCEPTION_LOCK_WAIT_TIMEOUT = 'Doctrine\DBAL\Exception\LockWaitTimeoutException';
/** /**
* The driver mock under test. * The driver mock under test.
......
...@@ -134,6 +134,12 @@ class AbstractMySQLDriverTest extends AbstractDriverTest ...@@ -134,6 +134,12 @@ class AbstractMySQLDriverTest extends AbstractDriverTest
array('1569', null, null), array('1569', null, null),
array('1586', null, null), array('1586', null, null),
), ),
self::EXCEPTION_DEADLOCK => array(
array('1213', null, null),
),
self::EXCEPTION_LOCK_WAIT_TIMEOUT => array(
array('1205', null, null),
),
); );
} }
} }
...@@ -101,6 +101,10 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -101,6 +101,10 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => array( self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => array(
array(null, '23505', null), array(null, '23505', null),
), ),
self::EXCEPTION_DEADLOCK => array(
array(null, '40001', null),
array(null, '40P01', null),
),
); );
} }
} }
...@@ -93,6 +93,9 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest ...@@ -93,6 +93,9 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
array('-193', null, null), array('-193', null, null),
array('-196', null, null), array('-196', null, null),
), ),
self::EXCEPTION_DEADLOCK => array(
array('-306', null, null),
),
); );
} }
} }
...@@ -73,6 +73,9 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest ...@@ -73,6 +73,9 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest
array(null, null, 'is not unique'), array(null, null, 'is not unique'),
array(null, null, 'are not unique'), array(null, null, 'are not unique'),
), ),
self::EXCEPTION_LOCK_WAIT_TIMEOUT => array(
array(null, null, 'database is locked'),
),
); );
} }
} }
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