Files
php-src/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt
Peter Kokot 61e62a4dc9 Update ext/{pdo_sqlite,sqlite3} tests (#21198)
- Added SKIPIF sections for tests that use Pdo\Sqlite::DETERMINISTIC
  as it is available since libsqlite 3.8.3.
- Removed outdated SKIPIF sections for libsqlite versions 3.7.4

When using libsqlite 3.7.17 there are two more failing tests due to
different warning messages:
- ext/sqlite3/tests/sqlite3_38_extended_error.phpt
- ext/sqlite3/tests/sqlite3_39_toggleExtended.phpt

This fix doesn't address these as minimum required libsqlite will be
updated in the future PHP versions anyway at some point and this won't
be an issue anymore then.
2026-04-28 18:58:51 +02:00

34 lines
791 B
PHP

--TEST--
SQLite3::createFunction - Test with flags
--EXTENSIONS--
sqlite3
--SKIPIF--
<?php
if (!defined('SQLITE3_DETERMINISTIC')) die('skip SQLITE3_DETERMINISTIC requires SQLite library >= 3.8.3');
?>
--FILE--
<?php
require_once(__DIR__ . '/new_db.inc');
$func = 'strtoupper';
var_dump($db->createfunction($func, $func, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle("SELECT strtoupper('test')"));
$func2 = 'strtolower';
var_dump($db->createfunction($func2, $func2, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle("SELECT strtolower('TEST')"));
var_dump($db->createfunction($func, $func2, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle("SELECT strtoupper('tEst')"));
?>
--EXPECT--
bool(true)
string(4) "TEST"
bool(true)
string(4) "test"
bool(true)
string(4) "test"