1--TEST--
2SQLite3::createAggregate() Test whether a supplied PHP function is valid when using in an aggregate function
3--CREDITS--
4James Cauwelier
5# Belgium PHP TestFest (2009)
6--SKIPIF--
7<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
8--FILE--
9<?php
10
11function aggregate_step ($var) { return $var; }
12function aggregate_final ($var) { return $var; }
13
14$db = new SQLite3(':memory:');
15
16$db->createAggregate ('TESTAGGREGATE', 'aggregate_test_step', 'aggregate_final');
17$db->createAggregate ('TESTAGGREGATE2', 'aggregate_step', 'aggregate_test_final');
18var_dump($db->createAggregate ('TESTAGGREGATE3', 'aggregate_step', 'aggregate_final'));
19
20$db->close();
21
22echo "Done"
23?>
24--EXPECTF--
25Warning: SQLite3::createAggregate(): Not a valid callback function aggregate_test_step in %s on line %d
26
27Warning: SQLite3::createAggregate(): Not a valid callback function aggregate_test_final in %s on line %d
28bool(true)
29Done
30