1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 17:29:53 +02:00

new directory structure, moved to /src

This commit is contained in:
David Grudl
2015-01-13 16:27:01 +01:00
parent c96271c09b
commit 2522dcd7fe
74 changed files with 60 additions and 70 deletions

View File

@@ -0,0 +1,37 @@
<?php
/**
* @dataProvider ../databases.ini
*/
use Tester\Assert;
require __DIR__ . '/bootstrap.php';
test(function () use ($config) {
$conn = new DibiConnection($config);
Assert::true($conn->isConnected());
$conn->disconnect();
Assert::false($conn->isConnected());
});
test(function () use ($config) { // lazy
$conn = new DibiConnection($config + array('lazy' => TRUE));
Assert::false($conn->isConnected());
$conn->query('SELECT 1');
Assert::true($conn->isConnected());
});
test(function () use ($config) { // query string
$conn = new DibiConnection(http_build_query($config, NULL, '&'));
Assert::true($conn->isConnected());
Assert::null($conn->getConfig('lazy'));
Assert::same($config['driver'], $conn->getConfig('driver'));
Assert::type('IDibiDriver', $conn->getDriver());
});