1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 23:26:49 +02:00

MySqliDriver: refactoring, uses OOP style

This commit is contained in:
David Grudl
2018-05-09 12:27:10 +02:00
parent 8dff5b5b3c
commit bd8ce38320
3 changed files with 42 additions and 20 deletions

View File

@@ -15,6 +15,18 @@ $conn = new Dibi\Connection($config);
$conn->loadFile(__DIR__ . "/data/$config[system].sql");
$e = Assert::exception(function () use ($conn) {
new Dibi\Connection([
'driver' => 'mysqli',
'host' => 'localhost',
'username' => 'unknown',
'password' => 'unknown',
]);
}, Dibi\DriverException::class);
Assert::null($e->getSql());
$e = Assert::exception(function () use ($conn) {
$conn->query('SELECT');
}, Dibi\DriverException::class, '%a% error in your SQL syntax;%a%', 1064);