File: gh-issue047_jsonb.phpt

package info (click to toggle)
php-pq 2.2.3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 788 kB
  • sloc: ansic: 8,210; xml: 175; sh: 102; awk: 40; pascal: 9; makefile: 1
file content (41 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
json conv broken since 2.2.1
--SKIPIF--
<?php
define("SERVER_MIN", "9.4");
include "_skipif.inc";
?>
--INI--
date.timezone=UTC
--FILE--
<?php
echo "Test\n";

include "_setup.inc";

$c = new pq\Connection(PQ_DSN);
$c->defaultFetchType = \pq\Result::FETCH_ASSOC;

$q = <<<EOF
    SELECT '0'::jsonb UNION SELECT '"text"'::jsonb;
EOF;
$r = $c->exec($q);

var_dump($r->fetchAll());
?>
===DONE===
--EXPECT--
Test
array(2) {
  [0]=>
  array(1) {
    ["jsonb"]=>
    string(4) "text"
  }
  [1]=>
  array(1) {
    ["jsonb"]=>
    int(0)
  }
}
===DONE===