1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

tests: improved descriptions

This commit is contained in:
David Grudl
2025-02-03 02:03:58 +01:00
parent 5732def240
commit 6bbfb23699
2 changed files with 16 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ use Tester\Assert;
require __DIR__ . '/bootstrap.php';
test('', function () use ($config) {
test('immediate connection and disconnection state', function () use ($config) {
$conn = new Connection($config);
Assert::true($conn->isConnected());
@@ -21,7 +21,7 @@ test('', function () use ($config) {
});
test('lazy', function () use ($config) {
test('lazy connection initiated on first query', function () use ($config) {
$conn = new Connection($config + ['lazy' => true]);
Assert::false($conn->isConnected());
@@ -30,7 +30,7 @@ test('lazy', function () use ($config) {
});
test('', function () use ($config) {
test('config retrieval and driver instance access', function () use ($config) {
$conn = new Connection($config);
Assert::true($conn->isConnected());
@@ -40,7 +40,7 @@ test('', function () use ($config) {
});
test('', function () use ($config) {
test('idempotent disconnect calls', function () use ($config) {
$conn = new Connection($config);
Assert::true($conn->isConnected());
@@ -52,7 +52,7 @@ test('', function () use ($config) {
});
test('', function () use ($config) {
test('reconnect after disconnection', function () use ($config) {
$conn = new Connection($config);
Assert::equal('hello', $conn->query('SELECT %s', 'hello')->fetchSingle());
@@ -63,7 +63,7 @@ test('', function () use ($config) {
});
test('', function () use ($config) {
test('destructor disconnects active connection', function () use ($config) {
$conn = new Connection($config);
Assert::true($conn->isConnected());
@@ -72,7 +72,7 @@ test('', function () use ($config) {
});
test('', function () use ($config) {
test('invalid onConnect option triggers exceptions', function () use ($config) {
Assert::exception(
fn() => new Connection($config + ['onConnect' => '']),
InvalidArgumentException::class,

View File

@@ -25,7 +25,7 @@ class MockResult extends Dibi\Result
}
test('', function () {
test('native text conversion preserves boolean values', function () {
$result = new MockResult;
$result->setType('col', Type::Text);
$result->setFormat(Type::Text, 'native');
@@ -36,7 +36,7 @@ test('', function () {
});
test('', function () {
test('boolean conversion from diverse representations', function () {
$result = new MockResult;
$result->setType('col', Type::Bool);
@@ -58,7 +58,7 @@ test('', function () {
});
test('', function () {
test('text conversion of booleans and numerics', function () {
$result = new MockResult;
$result->setType('col', Type::Text);
@@ -74,7 +74,7 @@ test('', function () {
});
test('', function () {
test('float conversion with various numeric formats', function () {
$result = new MockResult;
$result->setType('col', Type::Float);
@@ -214,7 +214,7 @@ test('', function () {
});
test('', function () {
test('strict integer conversion with error on empty string', function () {
$result = new MockResult;
$result->setType('col', Type::Integer);
@@ -244,7 +244,7 @@ test('', function () {
});
test('', function () {
test('dateTime conversion with object instantiation', function () {
$result = new MockResult;
$result->setType('col', Type::DateTime);
@@ -263,7 +263,7 @@ test('', function () {
});
test('', function () {
test('dateTime conversion using custom format', function () {
$result = new MockResult;
$result->setType('col', Type::DateTime);
$result->setFormat(Type::DateTime, 'Y-m-d H:i:s');
@@ -283,7 +283,7 @@ test('', function () {
});
test('', function () {
test('date conversion to DateTime instance', function () {
$result = new MockResult;
$result->setType('col', Type::Date);
@@ -300,7 +300,7 @@ test('', function () {
});
test('', function () {
test('time conversion to DateTime instance', function () {
$result = new MockResult;
$result->setType('col', Type::Time);