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:
37
tests/dibi/Connection.connect.phpt
Normal file
37
tests/dibi/Connection.connect.phpt
Normal 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());
|
||||
});
|
Reference in New Issue
Block a user