1--TEST--
2PDO_sqlite: Testing sqliteCreateFunction()
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7
8$db = new PDO('sqlite::memory:');
9
10$db->query('CREATE TABLE test_pdo_sqlite_createfunction (id INT AUTO INCREMENT, name TEXT)');
11
12$db->query('INSERT INTO test_pdo_sqlite_createfunction VALUES (NULL, "PHP"), (NULL, "PHP6")');
13
14
15$db->sqliteCreateFunction('testing', function($v) { return strtolower($v); });
16
17
18foreach ($db->query('SELECT testing(name) FROM test_pdo_sqlite_createfunction') as $row) {
19    var_dump($row);
20}
21
22?>
23--EXPECT--
24array(2) {
25  ["testing(name)"]=>
26  string(3) "php"
27  [0]=>
28  string(3) "php"
29}
30array(2) {
31  ["testing(name)"]=>
32  string(4) "php6"
33  [0]=>
34  string(4) "php6"
35}
36