]> granicus.if.org Git - php/commitdiff
Fix PDO::inTransaction() test for pgsql
authorNikita Popov <nikic@php.net>
Sun, 24 Mar 2013 16:52:16 +0000 (17:52 +0100)
committerMatteo Beccati <mbeccati@php.net>
Sun, 2 Jun 2013 11:28:30 +0000 (13:28 +0200)
inTransaction() nowadays casts the in_transaction result to boolean.
I'm not sure whether the INERROR state should result in true or false.
For now I went with the result that we actually get.

ext/pdo_pgsql/tests/is_in_transaction.phpt

index 99ff56162d8ae55fefae7d012e05e0cdf5e9bfa8..72da4f4e0792201828440795be4ed1fd9061b471 100644 (file)
@@ -57,10 +57,10 @@ var_dump($db->inTransaction());
 ?>
 --EXPECT--
 Test PDO::PGSQL_TRANSACTION_INTRANS
-int(2)
+bool(true)
 Test PDO::PGSQL_TRANSACTION_IDLE
-int(0)
+bool(false)
 Test PDO::PGSQL_TRANSACTION_INERROR
-int(3)
+bool(true)
 Test PDO::PGSQL_TRANSACTION_IDLE
-int(0)
+bool(false)