Skip to content

Commit 7f42ddc

Browse files
committed
add test
1 parent 4494e12 commit 7f42ddc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ foreach ($result as $row) {
2424
echo $row['name'] . "\n";
2525
}
2626

27+
$db->sqliteCreateCollation('MYCOLLATEBAD', function($a, $b) { return $a; });
28+
29+
try {
30+
$db->query('SELECT name FROM test_pdo_sqlite_createcollation ORDER BY name COLLATE MYCOLLATEBAD');
31+
} catch (\TypeError $e) {
32+
echo $e->getMessage(), PHP_EOL;
33+
}
2734
?>
2835
--EXPECT--
2936
1
@@ -32,3 +39,4 @@ foreach ($result as $row) {
3239
1
3340
10
3441
2
42+
PDO::query(): Return value of the collation callback must be of type int, string returned

0 commit comments

Comments
 (0)