Skip to content

Commit 5faef8e

Browse files
committed
Fixed the test because libmysql results type is string. (#16709)
closes #16709
1 parent a800a03 commit 5faef8e

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

ext/pdo_mysql/tests/gh16314.phpt

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,57 @@ MySQLPDOTest::skip();
1111
<?php
1212
require_once __DIR__ . '/inc/mysql_pdo_test.inc';
1313

14-
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], false);
14+
$attr = [
15+
PDO::ATTR_PERSISTENT => true,
16+
PDO::ATTR_STRINGIFY_FETCHES => true,
17+
];
18+
19+
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, false);
1520
var_dump($pdo->query('SELECT 1;')->fetchAll());
1621

17-
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], true);
22+
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, true);
1823
var_dump($pdo->query('SELECT 1;')->fetchAll());
1924

20-
$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], false);
25+
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, false);
2126
var_dump($pdo->query('SELECT 1;')->fetchAll());
2227

23-
$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], true);
28+
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, true);
2429
var_dump($pdo->query('SELECT 1;')->fetchAll());
2530
?>
2631
--EXPECT--
2732
array(1) {
2833
[0]=>
2934
array(2) {
3035
[1]=>
31-
int(1)
36+
string(1) "1"
3237
[0]=>
33-
int(1)
38+
string(1) "1"
3439
}
3540
}
3641
array(1) {
3742
[0]=>
3843
array(2) {
3944
[1]=>
40-
int(1)
45+
string(1) "1"
4146
[0]=>
42-
int(1)
47+
string(1) "1"
4348
}
4449
}
4550
array(1) {
4651
[0]=>
4752
array(2) {
4853
[1]=>
49-
int(1)
54+
string(1) "1"
5055
[0]=>
51-
int(1)
56+
string(1) "1"
5257
}
5358
}
5459
array(1) {
5560
[0]=>
5661
array(2) {
5762
[1]=>
58-
int(1)
63+
string(1) "1"
5964
[0]=>
60-
int(1)
65+
string(1) "1"
6166
}
6267
}

0 commit comments

Comments
 (0)