php-src/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt
Nikita Popov 1afcced1f0 Add stubs for PDO SQLite extension methods
Putting these under a dummy PDO_SQLite_Ext class.
2020-07-21 12:49:36 +02:00

21 lines
552 B
PHP

--TEST--
PDO_sqlite: Testing sqliteCreateFunction() produces warning when
un-callable function passed
--CREDITS--
Chris MacPherson chris@kombine.co.uk
--SKIPIF--
<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
--FILE--
<?php
$db = new PDO( 'sqlite::memory:');
try {
$db->sqliteCreateFunction('bar-alias', 'bar');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
PDO::sqliteCreateFunction(): Argument #2 ($callback) must be a valid callback, function "bar" not found or invalid function name