Skip to content

Instantly share code, notes, and snippets.

@N3X15

N3X15/bug68156.phpt

Created Oct 5, 2014
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@N3X15 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