php-src/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt
Máté Kocsis d6a0b3af68
Implement PDO driver-specific subclasses
RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses
Closes GH-12804

Co-Authored-By: Danack <Danack@basereality.com>
2024-01-11 23:22:41 +01:00

25 lines
728 B
PHP

--TEST--
PDO_sqlite: Testing invalid callback for createAggregate()
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php
// This test was copied from the pdo_sqlite test for sqliteCreateAggregate
$pdo = new PdoSqlite('sqlite::memory:');
try {
$pdo->createAggregate('foo', 'a', '');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
$pdo->createAggregate('foo', 'strlen', '');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
PdoSqlite::createAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name
PdoSqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name