From 5faef8e6c97e0e7afa8da5554aa2b20aede6c4fb Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Wed, 6 Nov 2024 21:07:03 +0900 Subject: [PATCH] Fixed the test because libmysql results type is string. (#16709) closes #16709 --- ext/pdo_mysql/tests/gh16314.phpt | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ext/pdo_mysql/tests/gh16314.phpt b/ext/pdo_mysql/tests/gh16314.phpt index 65da24bd28edb..01955d3ba4a07 100644 --- a/ext/pdo_mysql/tests/gh16314.phpt +++ b/ext/pdo_mysql/tests/gh16314.phpt @@ -11,16 +11,21 @@ MySQLPDOTest::skip(); 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" } }