From 00271e741f7d4825c76b1db21a7c55b250f209e9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 1 Jun 2009 16:47:06 +0000 Subject: - Patch #458176 by c960657: improved exception handling in database layer. --- modules/simpletest/tests/database_test.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/simpletest/tests/database_test.test') diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 0263036ef..e5d5b3fe0 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -2446,6 +2446,9 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase { $this->pass(t('The whole transaction is rolled back when a duplicate key insert occurs.')); } + // 23000 means "Integrity constraint violation" according to ANSI SQL. + $this->assertEqual($e->errorInfo[0], '23000', t('Exception has proper SQLSTATE.')); + // Ensure the other values were not inserted. $record = db_select('test') ->fields('test', array('name', 'age')) -- cgit v1.2.3