mirror of
https://github.com/dg/dibi.git
synced 2025-02-22 09:53:11 +01:00
fixed tests
This commit is contained in:
parent
95c3f72a17
commit
3df64fc3b3
@ -72,7 +72,7 @@ class MySqliDriver implements Dibi\Driver
|
||||
$host = ini_get('mysqli.default_host');
|
||||
if ($host) {
|
||||
$config['host'] = $host;
|
||||
$config['port'] = ini_get('mysqli.default_port');
|
||||
$config['port'] = (int) ini_get('mysqli.default_port');
|
||||
} else {
|
||||
$config['host'] = null;
|
||||
$config['port'] = null;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @dataProvider ../databases.ini
|
||||
* @dataProvider ../databases.ini !=sqlsrv
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
@ -23,6 +23,10 @@ try {
|
||||
$config = reset($config);
|
||||
}
|
||||
|
||||
if (isset($config['port'])) {
|
||||
$config['port'] = (int) $config['port'];
|
||||
}
|
||||
|
||||
|
||||
// lock
|
||||
define('TEMP_DIR', __DIR__ . '/../tmp');
|
||||
|
@ -36,7 +36,7 @@ Assert::same('SELECT', $e->getSql());
|
||||
|
||||
$e = Assert::exception(function () use ($conn) {
|
||||
$conn->query('INSERT INTO products (product_id, title) VALUES (1, "New")');
|
||||
}, Dibi\UniqueConstraintViolationException::class, "%a?%Duplicate entry '1' for key 'PRIMARY'", 1062);
|
||||
}, Dibi\UniqueConstraintViolationException::class, "%a?%Duplicate entry '1' for key '%a?%PRIMARY'", 1062);
|
||||
|
||||
Assert::same("INSERT INTO products (product_id, title) VALUES (1, 'New')", $e->getSql());
|
||||
|
||||
|
@ -31,7 +31,7 @@ Assert::same("INSERT INTO products (product_id, title) VALUES (1, 'New')", $e->g
|
||||
|
||||
$e = Assert::exception(function () use ($conn) {
|
||||
$conn->query('INSERT INTO products (title) VALUES (NULL)');
|
||||
}, Dibi\NotNullConstraintViolationException::class, '%a?%null value in column "title" violates not-null constraint%A?%', '23502');
|
||||
}, Dibi\NotNullConstraintViolationException::class, '%a?%null value in column "title"%a%violates not-null constraint%A?%', '23502');
|
||||
|
||||
Assert::same('INSERT INTO products (title) VALUES (NULL)', $e->getSql());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user