xref: /php-src/ext/pdo_pgsql/tests/issue78621.phpt (revision a9259c04)
1--TEST--
2Pdo\Pgsql::setNoticeCallback catches Postgres "raise notice".
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
6require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
7require_once dirname(__FILE__) . '/config.inc';
8PDOTest::skip();
9?>
10--FILE--
11<?php
12function disp($message) { echo trim($message)."\n"; }
13function dispRe($message) { echo "Re".trim($message)."\n"; }
14function attach($db, $prefix = '')
15{
16    $db->setNoticeCallback('disp'.$prefix);
17}
18require dirname(__FILE__) . '/issue78621.inc';
19?>
20--EXPECT--
21NOTICE:  I tampered your data, did you know?
22ReNOTICE:  I tampered your data, did you know?
23array(1) {
24  [0]=>
25  array(1) {
26    ["a"]=>
27    string(2) "oh"
28  }
29}
30Done
31