mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

For rationale, see #6787 Extensions migrated in part 4: * simplexml * skeleton * soap * spl * sqlite3 * sysvmsg * sysvsem * tidy - also removed a check for an ancient dependency version
38 lines
1.1 KiB
PHP
38 lines
1.1 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->getMessage() . "\n";
|
|
}
|
|
|
|
try {
|
|
$db->createAggregate('TESTAGGREGATE2', 'aggregate_step', 'aggregate_test_final');
|
|
} catch (TypeError $exception) {
|
|
echo $exception->getMessage() . "\n";
|
|
}
|
|
|
|
var_dump($db->createAggregate ('TESTAGGREGATE3', 'aggregate_step', 'aggregate_final'));
|
|
|
|
$db->close();
|
|
|
|
echo "Done"
|
|
?>
|
|
--EXPECT--
|
|
SQLite3::createAggregate(): Argument #2 ($stepCallback) must be a valid callback, function "aggregate_test_step" not found or invalid function name
|
|
SQLite3::createAggregate(): Argument #3 ($finalCallback) must be a valid callback, function "aggregate_test_final" not found or invalid function name
|
|
bool(true)
|
|
Done
|