Files
php-src/ext/sqlite3/tests/sqlite3_33_createAggregate_notcallable.phpt
NickSdot 1da3a6398b Applied fixers to improve test robustness to extensions with no code owners (#23018)
* ext/bz2: applied fixers to improve test robustness

* ext/calendar: applied fixers to improve test robustness

* ext/exif: applied fixers to improve test robustness

* ext/fileinfo: applied fixers to improve test robustness

* ext/filter: applied fixers to improve test robustness

* ext/ftp: applied fixers to improve test robustness

* ext/hash: applied fixers to improve test robustness

* ext/iconv: applied fixers to improve test robustness

* ext/ldap: applied fixers to improve test robustness

* ext/pcre: applied fixers to improve test robustness

* ext/posix: applied fixers to improve test robustness

* ext/readline: applied fixers to improve test robustness

* ext/shmop: applied fixers to improve test robustness

* ext/snmp: applied fixers to improve test robustness

* ext/sodium: applied fixers to improve test robustness

* ext/sqlite3: applied fixers to improve test robustness

* ext/sysvmsg: applied fixers to improve test robustness

* ext/sysvsem: applied fixers to improve test robustness

* ext/sysvshm: applied fixers to improve test robustness

* ext/tidy: applied fixers to improve test robustness

* ext/tokenizer: applied fixers to improve test robustness

* ext/zend_test: applied fixers to improve test robustness

* ext/zlib: applied fixers to improve test robustness
2026-08-04 13:10:07 +01:00

39 lines
1.2 KiB
PHP

--TEST--
SQLite3::createAggregate() Test whether a supplied PHP function is valid when using in an aggregate function
--CREDITS--
James Cauwelier
# Belgium PHP TestFest (2009)
--EXTENSIONS--
sqlite3
--FILE--
<?php
function aggregate_step ($var) { return $var; }
function aggregate_final ($var) { return $var; }
$db = new SQLite3(':memory:');
try {
$db->createAggregate('TESTAGGREGATE', 'aggregate_test_step', 'aggregate_final');
} catch (TypeError $exception) {
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$db->createAggregate('TESTAGGREGATE2', 'aggregate_step', 'aggregate_test_final');
} catch (TypeError $exception) {
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump($db->createAggregate ('TESTAGGREGATE3', 'aggregate_step', 'aggregate_final'));
$db->close();
echo "Done"
?>
--EXPECT--
TypeError: SQLite3::createAggregate(): Argument #2 ($stepCallback) must be a valid callback, function "aggregate_test_step" not found or invalid function name
TypeError: SQLite3::createAggregate(): Argument #3 ($finalCallback) must be a valid callback, function "aggregate_test_final" not found or invalid function name
bool(true)
Done