summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests/80_bug36625.phpt
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2006-04-26 11:08:11 +0000
committerSVN Migration <svn@php.net>2006-04-26 11:08:11 +0000
commit79f14997b447f5917f16138d00d9877f1eeabae0 (patch)
treeaac481f9ab3d2192e236780a3c2b5b7fe18e3144 /ext/pgsql/tests/80_bug36625.phpt
parentad1bbaca04a802350884c07e2899a240d1a04e28 (diff)
downloadphp-git-php-5.1.2.tar.gz
This commit was manufactured by cvs2svn to create tag 'php_5_1_2'.php-5.1.2
Diffstat (limited to 'ext/pgsql/tests/80_bug36625.phpt')
-rwxr-xr-xext/pgsql/tests/80_bug36625.phpt49
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt
new file mode 100755
index 0000000000..a95cea7110
--- /dev/null
+++ b/ext/pgsql/tests/80_bug36625.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Bug #36625 (pg_trace() does not work)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+?>
+--FILE--
+<?php
+
+require_once('config.inc');
+
+$dbh = @pg_connect($conn_str);
+if (!$dbh) {
+ die ('Could not connect to the server');
+}
+
+$tracefile = dirname(__FILE__) . '/trace.tmp';
+
+@unlink($tracefile);
+var_dump(file_exists($tracefile));
+
+pg_trace($tracefile, 'w', $dbh);
+$res = pg_query($dbh, 'select 1');
+var_dump($res);
+pg_close($dbh);
+
+$found = 0;
+function search_trace_file($line)
+{
+ if (strpos($line, '"select 1"') !== false || strpos($line, "'select 1'") !== false) {
+ $GLOBALS['found']++;
+ }
+}
+
+$trace = file($tracefile);
+array_walk($trace, 'search_trace_file');
+var_dump($found > 0);
+var_dump(file_exists($tracefile));
+
+?>
+===DONE===
+--CLEAN--
+<?php unlink($tracefile); ?>
+--EXPECTF--
+bool(false)
+resource(%d) of type (pgsql result)
+bool(true)
+bool(true)
+===DONE===