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