mirror of
https://github.com/php/php-src.git
synced 2026-10-29 02:07:35 +08:00
* 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
39 lines
1.2 KiB
PHP
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
|