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:
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user