Fixed the test because libmysql results type is string. (#16709)

closes #16709
This commit is contained in:
Saki Takamachi 2024-11-06 21:07:03 +09:00
parent a800a03562
commit 5faef8e6c9
No known key found for this signature in database
GPG Key ID: 770426E17EBBB3DD

View File

@ -11,16 +11,21 @@ MySQLPDOTest::skip();
<?php
require_once __DIR__ . '/inc/mysql_pdo_test.inc';
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], false);
$attr = [
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_STRINGIFY_FETCHES => true,
];
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, false);
var_dump($pdo->query('SELECT 1;')->fetchAll());
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], true);
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, true);
var_dump($pdo->query('SELECT 1;')->fetchAll());
$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], false);
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, false);
var_dump($pdo->query('SELECT 1;')->fetchAll());
$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], true);
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, true);
var_dump($pdo->query('SELECT 1;')->fetchAll());
?>
--EXPECT--
@ -28,35 +33,35 @@ array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}