sqlite3_33_createAggregate_notcallable.phpt 913 B

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