summaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/ConnectionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DB/ConnectionTest.php')
-rw-r--r--tests/lib/DB/ConnectionTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/DB/ConnectionTest.php b/tests/lib/DB/ConnectionTest.php
index 62b168fbb53..857bb3cd79f 100644
--- a/tests/lib/DB/ConnectionTest.php
+++ b/tests/lib/DB/ConnectionTest.php
@@ -336,4 +336,17 @@ class ConnectionTest extends \Test\TestCase {
$this->assertEquals(0, $result);
}
+ /**
+ * @expectedException \Doctrine\DBAL\Exception\UniqueConstraintViolationException
+ */
+ public function testUniqueConstraintViolating() {
+ $this->makeTestTable();
+
+ $testQuery = 'INSERT INTO `*PREFIX*table` (`integerfield`, `textfield`) VALUES(?, ?)';
+ $testParams = [1, 'hello'];
+
+ $this->connection->executeUpdate($testQuery, $testParams);
+ $this->connection->executeUpdate($testQuery, $testParams);
+ }
+
}