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