Skip to content

Instantly share code, notes, and snippets.

@N3X15
Created October 5, 2014 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save N3X15/56ab6238a5a8e57bdc32 to your computer and use it in GitHub Desktop.
Save N3X15/56ab6238a5a8e57bdc32 to your computer and use it in GitHub Desktop.
PHPT for PHP #68156
--TEST--
Bug #68156 (pg_query_params Sets Boolean False to Blank String)
--SKIPIF--
<?php
include("skipif.inc");
skip_server_version('7.4', '<');
?>
--FILE--
<?php
error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
foreach(array(TRUE,FALSE) as $bool) {
echo "Inserting ".($bool?'true':'false');
pg_query("BEGIN");
pg_query("CREATE TABLE test_bool_table (a boolean)");
pg_query_params($db,'INSERT INTO test_bool_table (a) VALUES ($1)',array($bool));
pg_query("ROLLBACK");
}
?>
--EXPECT--
Inserting trueInserting false
@N3X15
Copy link
Author

N3X15 commented Oct 5, 2014

This is likely a terrible unit test and probably doesn't meet 20 standard requirements, but it does the job and it's 2:00AM. Also, qa.php.net is down, so I can't read the requirements. Have mercy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment