1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

tests: improved ini quering, removed duplicated tests

This commit is contained in:
David Grudl
2015-11-04 14:36:38 +01:00
parent 6730fb4633
commit 5aab1ff023
17 changed files with 28 additions and 240 deletions

View File

@@ -2,7 +2,7 @@
/**
* Test: query exceptions.
* @dataProvider ../databases.ini mysql
* @dataProvider? ../databases.ini mysql
*/
use Tester\Assert;
@@ -22,14 +22,14 @@ Assert::same('SELECT', $e->getSql());
$e = Assert::exception(function () use ($conn) {
$conn->query('INSERT INTO products (product_id, title) VALUES (1, "New")');
}, 'Dibi\UniqueConstraintViolationException', "Duplicate entry '1' for key 'PRIMARY'", 1062);
}, 'Dibi\UniqueConstraintViolationException', "%a?%Duplicate entry '1' for key 'PRIMARY'", 1062);
Assert::same("INSERT INTO products (product_id, title) VALUES (1, 'New')", $e->getSql());
$e = Assert::exception(function () use ($conn) {
$conn->query('INSERT INTO products (title) VALUES (NULL)');
}, 'Dibi\NotNullConstraintViolationException', "Column 'title' cannot be null", 1048);
}, 'Dibi\NotNullConstraintViolationException', "%a?%Column 'title' cannot be null", 1048);
Assert::same('INSERT INTO products (title) VALUES (NULL)', $e->getSql());