1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Files
archived-php-src/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt
2020-07-21 00:20:02 +01:00

25 lines
701 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 must be a valid callback, function "a" not found or invalid function name
PDO::sqliteCreateAggregate(): Argument #3 must be a valid callback, function "" not found or invalid function name