1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-29 08:49:50 +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 postgre
* @dataProvider? ../databases.ini postgre
*/
use Tester\Assert;
@@ -15,7 +15,7 @@ $conn->loadFile(__DIR__ . "/data/$config[system].sql");
$e = Assert::exception(function () use ($conn) {
$conn->query('SELECT INTO');
}, 'Dibi\DriverException', 'syntax error %A%');
}, 'Dibi\DriverException', '%a?%syntax error %A%');
Assert::same('SELECT INTO', $e->getSql());
@@ -29,7 +29,7 @@ Assert::same("INSERT INTO products (product_id, title) VALUES (1, 'New')", $e->g
$e = Assert::exception(function () use ($conn) {
$conn->query('INSERT INTO products (title) VALUES (NULL)');
}, 'Dibi\NotNullConstraintViolationException', 'null value in column "title" violates not-null constraint%A%', '23502');
}, 'Dibi\NotNullConstraintViolationException', '%a?%null value in column "title" violates not-null constraint%A?%', '23502');
Assert::same('INSERT INTO products (title) VALUES (NULL)', $e->getSql());