1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt
Nikita Popov 1afcced1f0 Add stubs for PDO SQLite extension methods
Putting these under a dummy PDO_SQLite_Ext class.
2020-07-21 12:49:36 +02:00

25 lines
731 B
PHP

--TEST--
PDO_sqlite: Testing invalid callback for sqliteCreateAggregate()
--SKIPIF--
<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
--FILE--
<?php
$pdo = new PDO('sqlite::memory:');
try {
$pdo->sqliteCreateAggregate('foo', 'a', '');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
$pdo->sqliteCreateAggregate('foo', 'strlen', '');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
PDO::sqliteCreateAggregate(): Argument #2 ($step_func) must be a valid callback, function "a" not found or invalid function name
PDO::sqliteCreateAggregate(): Argument #3 ($finalize_func) must be a valid callback, function "" not found or invalid function name