Created
October 5, 2014 09:22
-
-
Save N3X15/56ab6238a5a8e57bdc32 to your computer and use it in GitHub Desktop.
PHPT for PHP #68156
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.