mirror of
https://github.com/dg/dibi.git
synced 2025-08-19 04:11:44 +02:00
MySQL drivers: type TIME is returned as DateInterval (BC break) [Closes #168]
This commit is contained in:
17
tests/dibi/mysql-pdo.time.phpt
Normal file
17
tests/dibi/mysql-pdo.time.phpt
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @dataProvider ../databases.ini mysql-pdo
|
||||
*/
|
||||
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
$conn = new Dibi\Connection($config);
|
||||
|
||||
$conn->query('USE dibi_test');
|
||||
$conn->query('DROP TABLE IF EXISTS timetest');
|
||||
$conn->query('CREATE TABLE timetest (col TIME NOT NULL) ENGINE=InnoDB');
|
||||
$conn->query('INSERT INTO timetest VALUES ("12:30:40")');
|
||||
Assert::equal(new DateInterval('PT12H30M40S'), $conn->fetchSingle('SELECT * FROM timetest'));
|
17
tests/dibi/mysql.time.phpt
Normal file
17
tests/dibi/mysql.time.phpt
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @dataProvider ../databases.ini mysql
|
||||
*/
|
||||
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
$conn = new Dibi\Connection($config);
|
||||
|
||||
$conn->query('USE dibi_test');
|
||||
$conn->query('DROP TABLE IF EXISTS timetest');
|
||||
$conn->query('CREATE TABLE timetest (col TIME NOT NULL) ENGINE=InnoDB');
|
||||
$conn->query('INSERT INTO timetest VALUES ("12:30:40")');
|
||||
Assert::equal(new DateInterval('PT12H30M40S'), $conn->fetchSingle('SELECT * FROM timetest'));
|
17
tests/dibi/mysqli.time.phpt
Normal file
17
tests/dibi/mysqli.time.phpt
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @dataProvider ../databases.ini mysqli
|
||||
*/
|
||||
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
$conn = new Dibi\Connection($config);
|
||||
|
||||
$conn->query('USE dibi_test');
|
||||
$conn->query('DROP TABLE IF EXISTS timetest');
|
||||
$conn->query('CREATE TABLE timetest (col TIME NOT NULL) ENGINE=InnoDB');
|
||||
$conn->query('INSERT INTO timetest VALUES ("12:30:40")');
|
||||
Assert::equal(new DateInterval('PT12H30M40S'), $conn->fetchSingle('SELECT * FROM timetest'));
|
Reference in New Issue
Block a user