]> granicus.if.org Git - php/commitdiff
Adding CLEAN sections and making tests portable between PHP 5 and PHP 6 by replacing...
authorUlf Wendel <uw@php.net>
Wed, 4 Nov 2009 12:33:49 +0000 (12:33 +0000)
committerUlf Wendel <uw@php.net>
Wed, 4 Nov 2009 12:33:49 +0000 (12:33 +0000)
84 files changed:
ext/pdo_mysql/tests/bug41125.phpt
ext/pdo_mysql/tests/bug44327.phpt
ext/pdo_mysql/tests/bug46292.phpt
ext/pdo_mysql/tests/bug_33689.phpt
ext/pdo_mysql/tests/bug_37445.phpt
ext/pdo_mysql/tests/bug_39858.phpt
ext/pdo_mysql/tests/bug_41125.phpt
ext/pdo_mysql/tests/bug_41698.phpt
ext/pdo_mysql/tests/bug_41997.phpt
ext/pdo_mysql/tests/bug_42499.phpt
ext/pdo_mysql/tests/bug_44454.phpt
ext/pdo_mysql/tests/bug_44707.phpt
ext/pdo_mysql/tests/bug_pecl_12925.phpt
ext/pdo_mysql/tests/bug_pecl_7976.phpt
ext/pdo_mysql/tests/mysql_pdo_test.inc
ext/pdo_mysql/tests/pdo_mysql___construct.phpt
ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
ext/pdo_mysql/tests/pdo_mysql_bit.phpt
ext/pdo_mysql/tests/pdo_mysql_commit.phpt
ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
ext/pdo_mysql/tests/pdo_mysql_exec.phpt
ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt
ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
ext/pdo_mysql/tests/pdo_mysql_types.phpt
ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
ext/pdo_mysql/tests/pecl_bug_5200.phpt
ext/pdo_mysql/tests/pecl_bug_5780.phpt
ext/pdo_mysql/tests/pecl_bug_5802.phpt

index 5889a4d291012472ee118d0e789e0293f18f5c48..cd913bbf3aeb41d5b793807bd00368ac1ee04c61 100644 (file)
@@ -85,78 +85,78 @@ foreach ($queries as $k => $query) {
 ?>
 --EXPECT--
 1
-00000
+00000 -  - 
 -------------------------------------------------------
 [1] Query: [[SELECT 1 FROM DUAL WHERE 1 = '?\'\'']]
 
-00000
+00000 -  - 
 --------
 [2] Query: [[SELECT 'a\'0' FROM DUAL WHERE 1 = ?]]
 a'0
-00000
+00000 -  - 
 --------
 [3] Query: [[SELECT 'a', 'b\'' FROM DUAL WHERE '''' LIKE '\'' AND ?]]
 a - b'
-00000
+00000 -  - 
 --------
 [4] Query: [[SELECT 'foo?bar', '', '''' FROM DUAL WHERE ?]]
 foo?bar -  - '
-00000
+00000 -  - 
 --------
 Query: [[SELECT upper(:id) FROM DUAL WHERE '1']]
 O'\0
-00000
+00000 -  - 
 -------------------------------------------------------
 [1] Query: [[SELECT 1, 'foo' FROM DUAL WHERE 1 = :id AND '\0' IS NULL AND  2 <> :id]]
 
-00000
+00000 -  - 
 --------
 [2] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '' AND  2 <> :id]]
 
-00000
+00000 -  - 
 --------
 [3] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '\'\'' = '''' AND  2 <> :id]]
 
-00000
+00000 -  - 
 --------
 [4] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '\'' = '''' AND  2 <> :id]]
 1
-00000
+00000 -  - 
 --------
 [5] Query: [[SELECT 'a', 'b\'' FROM DUAL WHERE '''' LIKE '\'' AND 1]]
 a - b'
-00000
+00000 -  - 
 --------
 [6] Query: [[SELECT 'a''', '\'b\'' FROM DUAL WHERE '''' LIKE '\'' AND 1]]
 a' - 'b'
-00000
+00000 -  - 
 --------
 [7] Query: [[SELECT UPPER(:id) FROM DUAL WHERE '1']]
 1
-00000
+00000 -  - 
 --------
 [8] Query: [[SELECT 1 FROM DUAL WHERE '\'']]
 
-00000
+00000 -  - 
 --------
 [9] Query: [[SELECT 1 FROM DUAL WHERE :id AND '\0' OR :id]]
 1
-00000
+00000 -  - 
 --------
 [10] Query: [[SELECT 1 FROM DUAL WHERE 'a\f\n\0' AND 1 >= :id]]
 
-00000
+00000 -  - 
 --------
 [11] Query: [[SELECT 1 FROM DUAL WHERE '\'' = '''']]
 1
-00000
+00000 -  - 
 --------
 [12] Query: [[SELECT '\n' '1 FROM DUAL WHERE '''' and :id']]
 
 1 FROM DUAL WHERE '' and :id
-00000
+00000 -  - 
 --------
 [13] Query: [[SELECT 1 'FROM DUAL WHERE :id AND '''' = '''' OR 1 = 1 AND ':id]]
 1
-00000
+00000 -  - 
 --------
index 1d853a7f8590ad8561f37fccffc4f868baa2dda9..f82c4302d808bc7d1218bd445852a51111907edb 100644 (file)
@@ -42,22 +42,22 @@ $db = MySQLPDOTest::factory();
 ?>
 --EXPECTF--
 object(PDORow)#%d (2) {
-  [u"queryString"]=>
-  unicode(17) "SELECT 1 AS "one""
-  [u"one"]=>
-  string(1) "1"
+  [%u|b%"queryString"]=>
+  %unicode|string%(17) "SELECT 1 AS "one""
+  [%u|b%"one"]=>
+  %unicode|string%(1) "1"
 }
-unicode(1) "1"
-unicode(1) "1"
-unicode(17) "SELECT 1 AS "one""
+%unicode|string%(1) "1"
+%unicode|string%(1) "1"
+%unicode|string%(17) "SELECT 1 AS "one""
 ----------------------------------
 object(PDORow)#%d (2) {
-  [u"queryString"]=>
-  unicode(19) "SELECT id FROM test"
-  [u"id"]=>
-  unicode(1) "1"
+  [%u|b%"queryString"]=>
+  %unicode|string%(19) "SELECT id FROM test"
+  [%u|b%"id"]=>
+  %unicode|string%(1) "1"
 }
-unicode(19) "SELECT id FROM test"
+%unicode|string%(19) "SELECT id FROM test"
 ----------------------------------
 
 Notice: Trying to get property of non-object in %s on line %d
index 80423bc7a5d637c82deab89159e0d3322592c402..a0f9716c61c94f5116f5904ea18110e666f71cc8 100644 (file)
@@ -50,32 +50,35 @@ if (version_compare(PHP_VERSION, '5.1.0', '<'))
        var_dump($stmt->fetch());
        var_dump($stmt->fetch());
        var_dump($stmt->fetchAll());
-       
-       $pdoDb->query('DROP TABLE IF EXISTS testz');
-       
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS testz');
 ?>
 --EXPECTF--
 bool(true)
 myclass::__construct()
 object(myclass)#%d (1) {
-  ["value"]=>
-  string(1) "1"
+  [%u|b%"value"]=>
+  %unicode|string%(1) "1"
 }
 myclass::__construct()
 object(myclass2)#%d (1) {
-  ["value"]=>
-  string(1) "2"
+  [%u|b%"value"]=>
+  %unicode|string%(1) "2"
 }
 myclass::__construct()
 array(2) {
   [0]=>
   object(myclass)#%d (1) {
-    ["value"]=>
+    [%u|b%"value"]=>
     NULL
   }
   [1]=>
   object(stdClass)#%d (1) {
-    ["value"]=>
+    [%u|b%"value"]=>
     NULL
   }
 }
index 88392ef32f2633adabb0c4521c381c120c7de1ff..5969cae6a6639cf9ad4fc98bf84cc108ef3520f9 100644 (file)
@@ -34,10 +34,15 @@ else
 
 print_r($tmp);
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 object(PDOStatement)#%d (1) {
-  ["queryString"]=>
-  string(18) "SELECT * from test"
+  [%u|b%"queryString"]=>
+  %unicode|string%(18) "SELECT * from test"
 }
 Array
 (
index 524a3d0807a296149859a1abec8d8fef204bc8e3..8e915332d4278ade122eac6e59e2e363df0f994a 100644 (file)
@@ -15,7 +15,6 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
 $db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
 $stmt = $db->prepare("SELECT 1");
 $stmt->bindParam(':a', 'b');
-
 ?>
 --EXPECTF--
 Fatal error: Cannot pass parameter 2 by reference in %sbug_37445.php on line %d
index 6a2124d3ba2b6d167c55a3f54113d8d57a81f0a6..47457180a5b60a86e4ed85aaec845426aa15daab 100644 (file)
@@ -62,35 +62,41 @@ bug_39858($db);
 
 print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP PROCEDURE IF EXISTS p");
+?>
 --EXPECTF--
 Emulated Prepared Statements...
 array(1) {
   [0]=>
   array(1) {
-    ["2 * 2"]=>
-    string(1) "4"
+    [%u|b%"2 * 2"]=>
+    %unicode|string%(1) "4"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["2 * 2"]=>
-    string(1) "4"
+    [%u|b%"2 * 2"]=>
+    %unicode|string%(1) "4"
   }
 }
 Native Prepared Statements...
 array(1) {
   [0]=>
   array(1) {
-    ["2 * 2"]=>
-    string(1) "4"
+    [%u|b%"2 * 2"]=>
+    %unicode|string%(1) "4"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["2 * 2"]=>
-    string(1) "4"
+    [%u|b%"2 * 2"]=>
+    %unicode|string%(1) "4"
   }
 }
 done!
index 1f54cca5f1565141d4b91dc1be3b396ca7d4ec04..a1d8dd1ae40cd3ab6193c5eaa5dcdce45b87089b 100644 (file)
@@ -22,6 +22,7 @@ if ($version < 40100)
 <?php
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
 $db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
 
 // And now allow the evil to do his work
 $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);
@@ -37,6 +38,12 @@ do {
 
 print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
+?>
 --EXPECTF--
 Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
 array(0) {
index b2dee60d74e84bcdd93954cae45517815d4e5598..890ba77617a1ec24cdac6e11c257a284277e9456 100644 (file)
@@ -22,16 +22,16 @@ $stmt = $db->prepare('INSERT INTO test VALUES(?)');
 $stmt->execute(array($value));
 var_dump($db->query('SELECT * from test')->fetchAll(PDO::FETCH_ASSOC));
 ?>
---EXPECT--
+--EXPECTF--
 array(2) {
   [0]=>
   array(1) {
-    ["floatval"]=>
-    string(8) "2.340000"
+    [%u|b%"floatval"]=>
+    %unicode|string%(8) "2.340000"
   }
   [1]=>
   array(1) {
-    ["floatval"]=>
-    string(8) "4.560000"
+    [%u|b%"floatval"]=>
+    %unicode|string%(8) "4.560000"
   }
 }
\ No newline at end of file
index 60bdfee2ba4964b06af1dedb8d5be8add96761da..ee0cfe9ac2bcd7b01b1a57866588cf1729e5e671 100644 (file)
@@ -38,27 +38,35 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 var_dump($stmt->errorInfo());
 print "done!";
 ?>
---EXPECT--
+--EXPECTF--
 array(1) {
   [0]=>
   array(1) {
-    ["one"]=>
-    string(1) "1"
+    [%u|b%"one"]=>
+    %unicode|string%(1) "1"
   }
 }
-array(1) {
+array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
+  [1]=>
+  NULL
+  [2]=>
+  NULL
 }
 array(1) {
   [0]=>
   array(1) {
-    ["two"]=>
-    string(1) "2"
+    [%u|b%"two"]=>
+    %unicode|string%(1) "2"
   }
 }
-array(1) {
+array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
+  [1]=>
+  NULL
+  [2]=>
+  NULL
 }
-done!
\ No newline at end of file
+done!
index 2be99b4ae895a6e1ef25a90a5cdb0f6cc7bba433..dece019a9f2a4a61857baa5bbb5594480a1c558d 100644 (file)
@@ -61,8 +61,8 @@ Emulated Prepared Statements...
 array(1) {
   [0]=>
   array(1) {
-    ["_id"]=>
-    string(1) "a"
+    [%u|b%"_id"]=>
+    %unicode|string%(1) "a"
   }
 }
 
@@ -71,8 +71,8 @@ Native Prepared Statements...
 array(1) {
   [0]=>
   array(1) {
-    ["_id"]=>
-    unicode(1) "a"
+    [%u|b%"_id"]=>
+    %unicode|string%(1) "a"
   }
 }
 
index e8f91a00aa0647feea5a88c3fc1baab38935b347..7ad7f854599a02060c8d24032b5b3f024abe0e56 100644 (file)
@@ -63,9 +63,15 @@ bug_44454($db);
 
 print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --XFAIL--
 For some reason the exception gets thrown at the wrong place
---EXPECT--
+--EXPECTF--
 Native Prepared Statements
 ... SELECT has returned 1 row...
 ... INSERT should fail...
index d5d4539fcc01a9f39b580c2c998ea8bab48480e0..18c81040fe83b281fb31c46285c0e1d554bec610 100644 (file)
@@ -73,7 +73,7 @@ bug_44707($db);
 
 print "done!";
 ?>
---EXPECT--
+--EXPECTF--
 Native Prepared Statements
 bool(false)
 bool(false)
@@ -83,10 +83,10 @@ array(0) {
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["mybool"]=>
-    string(1) "0"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"mybool"]=>
+    %unicode|string%(1) "0"
   }
 }
 done!
index 1d398ff854a81a7458ab847ab19d7d79470c87a5..1867868ecb852cc0ee21b6ab2cc87097cf2931c6 100644 (file)
@@ -42,21 +42,21 @@ bug_pecl_1295($db);
 $db->exec('DROP TABLE IF EXISTS test');
 print "done!";
 ?>
---EXPECT--
+--EXPECTF--
 Emulated...
 array(1) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "c"
   }
 }
 Native...
 array(1) {
   [0]=>
   array(1) {
-    ["id"]=>
-    unicode(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "c"
   }
 }
 done!
\ No newline at end of file
index d92ed5e900aa7e7e3596f88e5020b95af56ac480..5f585bd013b1e27a9044043530a4236b862aa780 100644 (file)
@@ -48,40 +48,45 @@ $db = MySQLPDOTest::factory();
 $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
 bug_pecl_7976($db);
 
-$db->exec('DROP PROCEDURE IF EXISTS p');
 print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP PROCEDURE IF EXISTS p');
+?>
 --XFAIL--
 Works with mysqlnd. It is not supported by libmysql. For libmysql is good enough to see no crash.
---EXPECT--
+--EXPECTF--
 Emulated...
 array(1) {
   [0]=>
   array(1) {
-    ["_one"]=>
-    string(1) "1"
+    [%u|b%"_one"]=>
+    %unicode|string%(1) "1"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["_one"]=>
-    string(1) "1"
+    [%u|b%"_one"]=>
+    %unicode|string%(1) "1"
   }
 }
 Native...
 array(1) {
   [0]=>
   array(1) {
-    ["_one"]=>
-    unicode(1) "1"
+    [%u|b%"_one"]=>
+    %unicode|string%(1) "1"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["_one"]=>
-    unicode(1) "1"
+    [%u|b%"_one"]=>
+    %unicode|string%(1) "1"
   }
 }
 done!
index aa98d1464a99e8a86f04603f924a761e352f44e0..7367919338970f23f1f8dcebf6e921c17496ea0f 100644 (file)
@@ -158,5 +158,12 @@ class MySQLPDOTest extends PDOTest {
                        return (bool)preg_match('/Client API version.*mysqlnd/', $tmp);
        }
 
+       static function dropTestTable($db = NULL) {
+               if (is_null($db)) 
+                       $db = self::factory();
+
+               $db->exec('DROP TABLE IF EXISTS test');
+       }
+
 }
-?>
+?>
\ No newline at end of file
index 8602a4971ce83c8395e27114c98ead8000d3195b..fa4bbafd85f50e79578524bf56f0f065153bc1d2 100644 (file)
@@ -285,6 +285,7 @@ MySQLPDOTest::skip();
        }
 
        print "done!";
+?>
 --EXPECTF--
 [002] invalid data source name, [n/a] n/a
 [003] invalid data source name, [n/a] n/a
index 5bd824b812d6678f0ff290121cee7f8a8bba4ff5..14f81a66f11750f73f18f3f65dba2687d78bbe70 100644 (file)
@@ -8,7 +8,6 @@ MySQLPDOTest::skip();
 /* TODO - fix this limitation */
 if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysql.sock")
        die("skip Fix test to run in other environments as well!");
-
 ?>
 --INI--
 pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
@@ -51,6 +50,7 @@ pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
        }
 
        print "done!";
+?>
 --EXPECTF--
 pdo.dsn.mysql cannot be accessed through ini_get_all()/ini_get()
 done!
\ No newline at end of file
index 8bd714d69838148b5c49ce8965678edfafa3ab06..b0959a3ac91bb853e8431bfb25cfeca4e5b5c441 100644 (file)
@@ -46,6 +46,8 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
                        PDO::MYSQL_ATTR_USE_BUFFERED_QUERY              => 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY',
                        PDO::MYSQL_ATTR_LOCAL_INFILE                                    => 'PDO::MYSQL_ATTR_LOCAL_INFILE',
                        PDO::MYSQL_ATTR_DIRECT_QUERY                                    => 'PDO::MYSQL_ATTR_DIRECT_QUERY',
+
+                       PDO::MYSQL_ATTR_INIT_COMMAND                                    => 'PDO::MYSQL_ATTR_INIT_COMMAND',
                );
 
                $defaults = array(
@@ -59,6 +61,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
                        PDO::MYSQL_ATTR_LOCAL_INFILE                                    => false,
                        /* TODO getAttribute() does not handle it */
                        PDO::MYSQL_ATTR_DIRECT_QUERY                                    => 1,
+                       PDO::MYSQL_ATTR_INIT_COMMAND                                    => '',
                );
 
                if (NULL !== ($db = @new PDO($dsn, $user, $pass, 'wrong type')))
@@ -140,6 +143,10 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
                set_option_and_check(21, PDO::MYSQL_ATTR_LOCAL_INFILE, true, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
                set_option_and_check(22, PDO::MYSQL_ATTR_LOCAL_INFILE, false, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
 
+               set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+               set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+               set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+
                set_option_and_check(33, PDO::MYSQL_ATTR_DIRECT_QUERY, 1, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
                set_option_and_check(34, PDO::MYSQL_ATTR_DIRECT_QUERY, 0, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
 
@@ -151,9 +158,11 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
        }
 
        print "done!";
+?>
 --EXPECTF--
 [003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!
 [003a] Expecting default value for 'PDO::ATTR_EMULATE_PREPARES' of '1'/integer, getAttribute() reports setting ''/boolean
+[003a] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
 
 Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
 [010] [TODO][CHANGEREQUEST] ATTR_EMULATE_PREPARES should be on
index 8a8e347a63206f38f31cebe7931c64a9b134534f..b4ee6ea7d9773ac50357fcc277410694774aad2a 100644 (file)
@@ -59,10 +59,6 @@ if (MySQLPDOTest::isPDOMySQLnd())
                                        $tmp, gettype($tmp));
                }
 
-               set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
-               set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
-               set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
-
                set_option_and_check(26, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, true, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
                set_option_and_check(27, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, false, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
 
@@ -79,6 +75,7 @@ if (MySQLPDOTest::isPDOMySQLnd())
        }
 
        print "done!";
+?>
 --EXPECTF--
 [001] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
 [023] Execting 'SET @a=1'/string got ''/boolean' for options 'PDO::MYSQL_ATTR_INIT_COMMAND'
index 470605a6a393ddb19c06b9a49a485a631029271a..7e92ff2e9a5d3bf5d8bb98cdaef04cf1bc370113 100644 (file)
@@ -22,7 +22,7 @@ MySQLPDOTest::skip();
 
                        if ($fp = @fopen($file, 'w')) {
                                // ok, great we can create a file with a DSN in it
-                               @fwrite($fp, $dsn);
+                               fwrite($fp, $dsn);
                                fclose($fp);
                                clearstatcache();
                                assert(file_exists($file));
@@ -38,7 +38,7 @@ MySQLPDOTest::skip();
                        }
 
                        if ($fp = @fopen($file, 'w')) {
-                               @fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
+                               fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
                                        chr(0), $dsn));
                                fclose($fp);
                                clearstatcache();
@@ -66,6 +66,7 @@ MySQLPDOTest::skip();
        }
 
        print "done!";
+?>
 --EXPECTF--
 Warning: PDO::__construct(%s
 [002] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=%s'), invalid data source URI
index b48952875e347a12b05f2972f0055b1519b85c60..b1e5507f6765de6149855ac5d994b46e7b3e95a4 100644 (file)
@@ -87,7 +87,12 @@ $db = MySQLPDOTest::factory();
 
        }
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 7d35ead7aebaec305167b599167e1ad25c6e6240..618d9e65e4be4da9df25e4fcaaa0d6ae535f03bb 100644 (file)
@@ -81,86 +81,91 @@ $db = MySQLPDOTest::factory();
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
        var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
-
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
+       
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
-unicode(15) "PDO::CASE_LOWER"
+%unicode|string%(15) "PDO::CASE_LOWER"
 array(2) {
   [0]=>
   array(6) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
     [0]=>
-    string(1) "1"
-    ["id_upper"]=>
-    string(1) "1"
+    %unicode|string%(1) "1"
+    [%u|b%"id_upper"]=>
+    %unicode|string%(1) "1"
     [1]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
     [2]=>
-    string(1) "a"
+    %unicode|string%(1) "a"
   }
   [1]=>
   array(6) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
     [0]=>
-    string(1) "2"
-    ["id_upper"]=>
-    string(1) "2"
+    %unicode|string%(1) "2"
+    [%u|b%"id_upper"]=>
+    %unicode|string%(1) "2"
     [1]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
     [2]=>
-    string(1) "b"
+    %unicode|string%(1) "b"
   }
 }
 array(2) {
   [0]=>
   array(10) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
     [0]=>
-    string(1) "1"
-    ["id_upper"]=>
-    string(1) "1"
+    %unicode|string%(1) "1"
+    [%u|b%"id_upper"]=>
+    %unicode|string%(1) "1"
     [1]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
     [2]=>
-    string(1) "a"
-    ["mixed"]=>
+    %unicode|string%(1) "a"
+    [%u|b%"mixed"]=>
     NULL
     [3]=>
     NULL
-    ["myupper"]=>
+    [%u|b%"myupper"]=>
     NULL
     [4]=>
     NULL
   }
   [1]=>
   array(10) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
     [0]=>
-    string(1) "2"
-    ["id_upper"]=>
-    string(1) "2"
+    %unicode|string%(1) "2"
+    [%u|b%"id_upper"]=>
+    %unicode|string%(1) "2"
     [1]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
     [2]=>
-    string(1) "b"
-    ["mixed"]=>
+    %unicode|string%(1) "b"
+    [%u|b%"mixed"]=>
     NULL
     [3]=>
     NULL
-    ["myupper"]=>
+    [%u|b%"myupper"]=>
     NULL
     [4]=>
     NULL
@@ -169,23 +174,23 @@ array(2) {
 array(1) {
   [0]=>
   array(10) {
-    ["ID"]=>
-    string(1) "1"
+    [%u|b%"ID"]=>
+    %unicode|string%(1) "1"
     [0]=>
-    string(1) "1"
-    ["LABEL"]=>
-    string(1) "a"
+    %unicode|string%(1) "1"
+    [%u|b%"LABEL"]=>
+    %unicode|string%(1) "a"
     [1]=>
-    string(1) "a"
-    ["MIXED"]=>
+    %unicode|string%(1) "a"
+    [%u|b%"MIXED"]=>
     NULL
     [2]=>
     NULL
-    ["MYUPPER"]=>
+    [%u|b%"MYUPPER"]=>
     NULL
     [3]=>
     NULL
-    ["LOWER"]=>
+    [%u|b%"LOWER"]=>
     NULL
     [4]=>
     NULL
@@ -194,26 +199,26 @@ array(1) {
 array(1) {
   [0]=>
   array(10) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
     [0]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
     [1]=>
-    string(1) "a"
-    ["MiXeD"]=>
+    %unicode|string%(1) "a"
+    [%u|b%"MiXeD"]=>
     NULL
     [2]=>
     NULL
-    ["MYUPPER"]=>
+    [%u|b%"MYUPPER"]=>
     NULL
     [3]=>
     NULL
-    ["ID"]=>
-    string(1) "1"
+    [%u|b%"ID"]=>
+    %unicode|string%(1) "1"
     [4]=>
-    string(1) "1"
+    %unicode|string%(1) "1"
   }
 }
 done!
\ No newline at end of file
index e3f21fbaf106f7d94ab5b49f66f5f6c05df951d7..2d939635c8138b033ad50c055082e5af17a1c909 100644 (file)
@@ -32,5 +32,6 @@ $db = MySQLPDOTest::factory();
                printf("[003] Did we change it from '%s' to '%s'?\n", $version, $new_version);
 
        print "done!";
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 038df3cdbcd39170434a6dc570e4d6cfc0f36be6..187f9ec2321b6394e6d9d8843d7ab19c4d2812a7 100644 (file)
@@ -32,5 +32,6 @@ $db = MySQLPDOTest::factory();
                printf("[005] Connection status should not have changed\n");
 
        print "done!";
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 0c156e4d1b9f2a88a921e3e44046742e04fd265d..8661dda5975060056a6f94d1b3b2ab375bf6e435 100644 (file)
@@ -25,6 +25,7 @@ $db = MySQLPDOTest::factory();
                printf("[002] Did we change it from '%s' to '%s'?\n", $name, $new_name);
 
        print "done!";
+?>
 --EXPECTF--
-string(5) "mysql"
+%unicode|string%(5) "mysql"
 done!
\ No newline at end of file
index 3b2b0929e4c12fc56f0636389bac7ddfb1aebb90..b9a4fc934d334a5c695b0f96212a1d19de1fe6f5 100644 (file)
@@ -23,19 +23,20 @@ MySQLPDOTest::skip();
        $stmt->closeCursor();
 
        print "done!";
+?>
 --EXPECTF--
 array(1) {
   [0]=>
   array(1) {
-    ["test.label"]=>
-    string(1) "a"
+    [%u|b%"test.label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 done!
index 8d086b7cc1cfa7e8e55b0ce81417f2b0179342f9..89e6f386e5da54957e6c04ca2c36f3040131fcba 100644 (file)
@@ -33,7 +33,8 @@ error_reporting=E_ALL
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
        $db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
-       print "done!\n";
+       print "done!";
+?>
 --EXPECTF--
 %unicode|string%(58) "CREATE TABLE test_%s(id INT)"
 %unicode|string%(5) "00000"
index 9ba8dee85f61a07886511d1044cdfc6b17ef81d6..115103df7531250cf948050c1b6ebaac8797d760 100644 (file)
@@ -62,6 +62,13 @@ if (MySQLPDOTest::isPDOMySQLnd())
        try_buffer_size(4, 2000);
 
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 [001] id = 1, val = 0123456789... (length: %d)
 [002] id = 1, val = 0123456789... (length: 1000)
index 9e938ef6a9b6e5d9af496ac90b8ed5cab5742bff..cdc0b264313d774e0f067e39d0bcba8182a8dd9a 100644 (file)
@@ -80,41 +80,42 @@ MySQLPDOTest::skip();
                @$db->exec('DROP PROCEDURE IF EXISTS p');
 
        print "done!";
+?>
 --EXPECTF--
 [002] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
 [003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
 array(1) {
   [0]=>
   array(6) {
-    ["z"]=>
+    [%u|b%"z"]=>
     NULL
-    ["a"]=>
+    [%u|b%"a"]=>
     NULL
-    ["b"]=>
-    string(1) " "
-    ["c"]=>
+    [%u|b%"b"]=>
+    %unicode|string%(1) " "
+    [%u|b%"c"]=>
     NULL
-    ["d"]=>
-    string(2) " d"
-    ["e"]=>
-    string(3) "%se"
+    [%u|b%"d"]=>
+    %unicode|string%(2) " d"
+    [%u|b%"e"]=>
+    %unicode|string%(3) "%se"
   }
 }
 array(1) {
   [0]=>
   array(6) {
-    ["z"]=>
+    [%u|b%"z"]=>
     NULL
-    ["a"]=>
-    string(0) ""
-    ["b"]=>
-    string(1) " "
-    ["c"]=>
-    string(0) ""
-    ["d"]=>
-    string(2) " d"
-    ["e"]=>
-    string(3) "%se"
+    [%u|b%"a"]=>
+    %unicode|string%(0) ""
+    [%u|b%"b"]=>
+    %unicode|string%(1) " "
+    [%u|b%"c"]=>
+    %unicode|string%(0) ""
+    [%u|b%"d"]=>
+    %unicode|string%(2) " d"
+    [%u|b%"e"]=>
+    %unicode|string%(3) "%se"
   }
 }
 done!
\ No newline at end of file
index 07bb8c39f5d796d23a5af397581f49d3a9af81c1..a59a6b0cc2e0cc9cb8ca125808fa227d97aec2b8 100644 (file)
@@ -60,5 +60,6 @@ $db = MySQLPDOTest::factory();
                printf("[010] Did we change it from '%s' to '%s'?\n", $version, $new_version);
 
        print "done!";
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index d077f6ebfe15cb3de78fe47f05c32bf68e5080e9..631a918dd067a7ae5066bab6a5899c6bab7941a0 100644 (file)
@@ -106,10 +106,11 @@ $db = MySQLPDOTest::factory();
        $stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 1');
 
        print "done!";
+?>
 --EXPECTF--
 array(1) {
   [0]=>
-  string(12) "PDOStatement"
+  %unicode|string%(12) "PDOStatement"
 }
 
 Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d
@@ -125,29 +126,29 @@ Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: user-supplied stat
 Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d
 array(2) {
   [0]=>
-  string(12) "mystatement4"
+  %unicode|string%(12) "mystatement4"
   [1]=>
   array(1) {
     [0]=>
-    string(6) "param1"
+    %unicode|string%(6) "param1"
   }
 }
 mystatement4
-string(6) "param1"
+%unicode|string%(6) "param1"
 mystatement5
-string(12) "mystatement5"
-string(10) "no data :)"
+%unicode|string%(12) "mystatement5"
+%unicode|string%(10) "no data :)"
 array(1) {
   [0]=>
   array(4) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
     [0]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
     [1]=>
-    string(1) "a"
+    %unicode|string%(1) "a"
   }
 }
 
index 209bf3d89d80edfeae8d0ab313a7a1793fb7dddc..8871a3170af0099f4f6e13790261cbd79d19f75d 100644 (file)
@@ -120,7 +120,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
        $tmp = $stmt->fetch(PDO::FETCH_ASSOC);
        if ($tmp['auto_commit'] != 0)
                printf("[026] Autocommit mode of the MySQL Server should be off, got '%s', [%d] %s\n",
-                       $tmp['auto_commit'], $stmt->errorCode(), implode(' ', $stmt->errorInfo()));
+                       $tmp['auto_commit'], $stmt->errorCode(), trim(implode(' ', $stmt->errorInfo())));
 
        $db->commit();
        // Now we should be back to autocommit - we've issues a commit
@@ -179,23 +179,28 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
        if (1 != $db->exec('DELETE FROM test'))
                printf("[038] No rows deleted, can't be true.\n");
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 array(2) {
-  ["id"]=>
-  string(1) "1"
-  ["label"]=>
-  string(1) "a"
+  [%u|b%"id"]=>
+  %unicode|string%(1) "1"
+  [%u|b%"label"]=>
+  %unicode|string%(1) "a"
 }
 bool(false)
 array(2) {
-  ["id"]=>
-  string(1) "1"
-  ["label"]=>
-  string(1) "z"
+  [%u|b%"id"]=>
+  %unicode|string%(1) "1"
+  [%u|b%"label"]=>
+  %unicode|string%(1) "z"
 }
 [026] Autocommit mode of the MySQL Server should be off, got '1', [0] 00000
 [028] I'm confused, how can autocommit be on? Didn't I say I want to manually control transactions?
-string(5) "00000"
-done!
\ No newline at end of file
+%unicode|string%(5) "00000"
+done!
index 18506acef9cf9ccd69e27efb55a759ad1b8ff450..899231a2173a6d2e284e571acda77d97cc6447f3 100644 (file)
@@ -35,7 +35,6 @@ if (MySQLPDOTest::isPDOMySQLnd())
                var_dump($row);
                var_dump($value);
 
-
                return true;
        }
 
@@ -48,12 +47,18 @@ if (MySQLPDOTest::isPDOMySQLnd())
 
        echo "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(2) {
-  ["id"]=>
-  string(2) "20"
-  ["label"]=>
-  string(1) "1"
+  [%u|b%"id"]=>
+  %unicode|string%(2) "20"
+  [%u|b%"label"]=>
+  %unicode|string%(1) "1"
 }
 int(1)
 done!
\ No newline at end of file
index 056c0e0231bd7cb7680b5e3fcdc8b4fbe03b689c..e213f66ea92b4b15f76e6b43e03be293b99f705c 100644 (file)
@@ -78,7 +78,13 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
                        $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test_commit'));
        print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test_commit');
+MySQLPDOTest::dropTestTable($db);
+?>
 --EXPECT--
 done!
\ No newline at end of file
index 35056a74d82a21b06d68c6da14802c3a2e31957f..b970c4ef94e40650756fd2f6d52c08b779a0c049 100644 (file)
@@ -75,7 +75,12 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 8829dc448abc55ea2332a6e220951f823ad46097..93e1fbf1a22cb31df22bf4aa3cbeb7b9cc8b2e23 100644 (file)
@@ -14,13 +14,9 @@ $db = MySQLPDOTest::factory();
        MySQLPDOTest::createTestTable($db);
 
        function check_error($offset, &$obj, $expected = '00000') {
-
                $info = $obj->errorInfo();
-               if (count($info) != 3)
-                       printf("[%03d] Info should have three fields, got %s\n",
-                               $offset, var_export($info, true));
-
                $code = $info[0];
+
                if (($code != $expected) && (($expected != '00000') && ($code != ''))) {
                        printf("[%03d] Expecting error code '%s' got code '%s'\n",
                                $offset, $expected, $code);
@@ -98,76 +94,18 @@ $db = MySQLPDOTest::factory();
        printf("Native Prepared Statements...\n");
        pdo_mysql_errorinfo($db, 20);
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Emulated Prepared Statements...
-[002] Info should have three fields, got array (
-  0 => '00000',
-)
-[003] Info should have three fields, got array (
-  0 => '00000',
-)
-[004] Info should have three fields, got array (
-  0 => '00000',
-)
-[005] Info should have three fields, got array (
-  0 => '00000',
-)
-[009] Info should have three fields, got array (
-  0 => '00000',
-)
-[010] Info should have three fields, got array (
-  0 => '00000',
-)
-[013] Info should have three fields, got array (
-  0 => '00000',
-)
-[014] Info should have three fields, got array (
-  0 => '00000',
-)
-[015] Info should have three fields, got array (
-  0 => 'IM001',
-)
 [015] Driver-specific error code not set
 [015] Driver-specific error message.not set
-[016] Info should have three fields, got array (
-  0 => 'IM001',
-)
 [016] Driver-specific error code not set
 [016] Driver-specific error message.not set
-[017] Info should have three fields, got array (
-  0 => '00000',
-)
-[018] Info should have three fields, got array (
-  0 => '00000',
-)
 Native Prepared Statements...
-[022] Info should have three fields, got array (
-  0 => '00000',
-)
-[023] Info should have three fields, got array (
-  0 => '00000',
-)
-[024] Info should have three fields, got array (
-  0 => '00000',
-)
-[025] Info should have three fields, got array (
-  0 => '00000',
-)
-[030] Info should have three fields, got array (
-  0 => '00000',
-)
-[033] Info should have three fields, got array (
-  0 => '00000',
-)
-[034] Info should have three fields, got array (
-  0 => '00000',
-)
-[037] Info should have three fields, got array (
-  0 => '00000',
-)
-[038] Info should have three fields, got array (
-  0 => '00000',
-)
-done!
\ No newline at end of file
+done!
index 5ca5f447926300e6e5e0d5601fee685f31aecb1a..381a2b51df5a7563b607f7d8654c657e54e0caa8 100644 (file)
@@ -170,8 +170,14 @@ MySQLPDOTest::skip();
        }
        $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
 
-       @$db->exec('DROP TABLE IF EXISTS test');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Warning: PDO::exec(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on line %d
 [016] [42000] 42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line %d
index 00a2de1692ce71fff1dad74df92b624668382dad..2e800535562baa8b534e70e82f45ec4910000f8c 100644 (file)
@@ -70,13 +70,6 @@ MySQLPDOTest::skip();
                11.1.17. DROP TABLESPACE Syntax
                */
 
-               // clean up
-               @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
-               @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
-               @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
-               @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
-
-
        } catch (PDOException $e) {
                printf("[001] %s, [%s] %s\n",
                        $e->getMessage(),
@@ -84,5 +77,16 @@ MySQLPDOTest::skip();
        }
 
        print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+MySQLPDOTest::dropTestTable($db);
+// clean up
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index ecfa502437e7752c661b5b6337470c7f3c65ca5d..1310c0e643d5e6b63c2982f343909485cac26e3b 100644 (file)
@@ -96,7 +96,13 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                        $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index a759f72cd473b36c147abc801686e91a3d85899a..ef85fabe6f3bfdcc26db203ab054f272f60c1e1e 100644 (file)
@@ -50,9 +50,15 @@ MySQLPDOTest::skip();
                        $e->getMessage(),
                        $db->errorCode(), implode(' ', $db->errorInfo()));
        }
-
-       @$db->exec(sprintf('DROP TABLE IF EXISTS test'));
+       
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Warning: PDO::exec(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in %s on line %d
 [006] Expecting '1'/integer got ''/boolean when running 'INSERT INTO test(id, col1) VALUES (2, "b")', [HY000] HY000 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
index a8cbde6ea677bb737bf5cf841f8bcc8d79755146..da886390c0cb67e7daf5f1fd9196559434fd2fcb 100644 (file)
@@ -56,33 +56,33 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
+?>
 --EXPECTF--
 [002] Suspicious FETCH_BOTH result, dumping
 array(2) {
   [0]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
   [1]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
 }
 array(2) {
   [1]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
   [2]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
 }
 [002] Expected differes from returned data, dumping
 array(2) {
   [0]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
   [1]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
 }
 array(2) {
   [1]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
   [2]=>
-  string(1) "1"
+  %unicode|string%(1) "1"
 }
 done!
\ No newline at end of file
index 74f17d5984fd64384aa6b263197ea2f50ba9204c..c992d3acf9cd8689f96c28496f591ece8bef27a2 100644 (file)
@@ -94,8 +94,13 @@ PDO::ATTR_CONNECTION_STATUS
 PDO::ATTR_SERVER_INFO
 */
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 [001] Call to PDO::setAttribute(int attribute, mixed value) has changed the type of value from integer to boolean, test will not work properly
 done!
\ No newline at end of file
index 552128cae13cd70542d04682c36133bb3f6b8414..2bb5573f3b557ea75933b16e345a06156d1f403e 100644 (file)
@@ -108,7 +108,12 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
index 2a892a17deb6e962647c10ee0b7eebdeff65ad27..eb0fff13e63d461bb1ef4ca62da35cb3a63152d7 100644 (file)
@@ -92,5 +92,6 @@ MySQLPDOTest::skip();
        }
 
        print "done!";
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 30e7bda479a6385ed0a9ef356d635f3611b25aa0..a570c1fd49b9c31912fd380fbf04983585ccc58b 100644 (file)
@@ -26,5 +26,6 @@ $db = MySQLPDOTest::factory();
        }
 
        print "done!";
+?>
 --EXPECT--
 done!
index fa942f3858f76f5d4fc5292dc68b6f499673f6e2..4447146eef1b1148a9dcbedf89d5e19c86374008 100644 (file)
@@ -316,99 +316,104 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --XFAIL--
 PDO's PS parser has some problems with invalid SQL and crashes from time to time
 (check with valgrind...)
 --EXPECTF--
 array(1) {
-  ["one"]=>
-  string(1) "1"
+  [%u|b%"one"]=>
+  %unicode|string%(1) "1"
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(12) ":placeholder"
+    [%u|b%"label"]=>
+    %unicode|string%(12) ":placeholder"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(12) ":placeholder"
+    [%u|b%"label"]=>
+    %unicode|string%(12) ":placeholder"
   }
 }
 array(2) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(9) "first row"
+    [%u|b%"label"]=>
+    %unicode|string%(9) "first row"
   }
   [1]=>
   array(1) {
-    ["label"]=>
-    string(10) "second row"
+    [%u|b%"label"]=>
+    %unicode|string%(10) "second row"
   }
 }
 array(2) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(3) "row"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(3) "row"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(3) "row"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(3) "row"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "?"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "?"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "?"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "?"
   }
 }
 array(2) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(9) "first row"
+    [%u|b%"label"]=>
+    %unicode|string%(9) "first row"
   }
   [1]=>
   array(1) {
-    ["label"]=>
-    string(10) "second row"
+    [%u|b%"label"]=>
+    %unicode|string%(10) "second row"
   }
 }
 array(2) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(3) "row"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(3) "row"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(3) "row"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(3) "row"
   }
 }
 done!
index 1f333b9a9932e5ca846e1148aed98301f7e6e0b3..c382025ba70b265b264b2fc70db51f19486e5350 100644 (file)
@@ -56,23 +56,30 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "?"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "?"
   }
 }
 now the same with native PS
 [005] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
-done!
\ No newline at end of file
+done!
index be83446c853c0195c739f9f25fba8ce7cc51c8f2..e8f7d39840aeaa6e6a9660f1f96ecb047d91078a 100644 (file)
@@ -52,13 +52,20 @@ MySQLPDOTest::skip();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec(sprintf('DROP TABLE IF EXISTS test'));
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
 [003] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
@@ -69,7 +76,9 @@ Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: num
 Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line 33
 [005] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
-done!
\ No newline at end of file
+done!
index 1f8a4c2c3f9cff1f27ae83b7cde6a58b0f47e318..b8b77ff5dbafda5be40daadc1f26aa8b7ce4f955 100644 (file)
@@ -100,9 +100,14 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                        implode(' ', $db->errorInfo()),
                        (isset($stmt)) ? implode(' ', $stmt->errorInfo()) : 'N/A');
        }
-
-       // $db->exec('DROP TABLE IF EXISTS test');
+       
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: %s in %s on line %d
 [004] [0] array (
index 54257be42eb1c409f67fcb13067d8de3b3252966..ba5142a0c86504cf2ec3b0fb495d54726b2c3abc 100644 (file)
@@ -36,8 +36,14 @@ MySQLPDOTest::skip();
 
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(0) {
 }
index 1d5f30160808b9283605e804388c0dd9d1dd271a..b9027c8980c1be170df367656d0acecc94dd0a41 100644 (file)
@@ -333,9 +333,14 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(1) {
   [0]=>
index 33c699c15fc0f5bee4af7e67586cabce66a27b74..8c367af249468cff831588d1033b68a2c1a0fc73 100644 (file)
@@ -66,9 +66,14 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Warning: PDOStatement::execute(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d
 [003] Execute has failed, '42S22' array (
index b497268f991a11a30998652c3ebd6171a3d7b84f..57a4529ac2246420ec1f30fdc9be3588ac507008 100644 (file)
@@ -26,9 +26,14 @@ $db = MySQLPDOTest::factory();
 
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(1) {
   [0]=>
index a84c8d56d268c69f0d91cad24cf7beb836817f38..c9d122a813105f274be4509d6d4f6b83399e6d26 100644 (file)
@@ -92,15 +92,22 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Native...
 
 Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
 [003] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
@@ -130,7 +137,9 @@ Native...
 Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
 [008] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
-done!
\ No newline at end of file
+done!
index c8d1a5ba832d0801b188f15e8704090e92d3882a..90cedef56170cc8620dcce77e6e773cc2053591b 100644 (file)
@@ -24,9 +24,13 @@ $db = MySQLPDOTest::factory();
        $stmt->execute(array(1, 1));
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in %s on line %d
 
index 6f673c78b218320091e01dac40ace4188360a6d2..c4a74eadfa25b3503db72294be7cb4557b5357c4 100644 (file)
@@ -64,12 +64,19 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 [003] Execute has failed, 'HY093' array (
   0 => 'HY093',
+  1 => NULL,
+  2 => NULL,
 )
 array(0) {
 }
@@ -82,4 +89,4 @@ array(1) {
     string(12) ":placeholder"
   }
 }
-done!
\ No newline at end of file
+done!
index aafad7085af3da4060fb41fd4bdce8d8aac1669a..0f8c8880e3a51d12bc2e755766a889cc0aefb1b6 100644 (file)
@@ -57,9 +57,14 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 array(1) {
   [0]=>
@@ -75,11 +80,11 @@ array(1) {
   [0]=>
   array(3) {
     ["?"]=>
-    unicode(2) "id"
+    string(2) "id"
     ["id"]=>
     int(1)
     ["label"]=>
-    unicode(4) "row1"
+    string(4) "row1"
   }
 }
 done!
\ No newline at end of file
index 358d4a780d4ed956a1938d75f711c0002d691d56..193b1a159c431da3d79de43468b6e7d476a9ea77 100644 (file)
@@ -79,9 +79,15 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
        $db->commit();
        var_dump($db->getAttribute(PDO::ATTR_AUTOCOMMIT));
 
-       $db->exec('DROP TABLE IF EXISTS test');
-       $db->exec('DROP TABLE IF EXISTS test2');
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
 --EXPECTF--
 int(1)
 int(0)
index 394ed4f45dff22c56a0cdba92e46a3949e9a99ca..dd4920e39ddff803ca5e88241bc03e291c2f523f 100644 (file)
@@ -99,9 +99,14 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 id = 1 (integer) / label = 'a' (string)
 id = 2 (integer) / label = 'b' (string)
index 993ea0447d04b36cebe7e84ad25291da4ba48f57..70b2f3fa2505ece3b580dd29904731cb751670a7 100644 (file)
@@ -114,9 +114,13 @@ MySQLPDOTest::skip();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Emulated PS...
 Buffered...
index 64d4df0641f8a1fabd81c18a2c27400ce6c22a19..9421f62eea46cc04f72b94561feb5e6126f7e835 100644 (file)
@@ -162,8 +162,12 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 6dc557d14fca6e437bc911aac7546518a27dece4..1c62d77314ed97bc34391bc24a2e1d2f78a20e3a 100644 (file)
@@ -293,9 +293,13 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Testing native PS...
 Binding variable...
index 88b847ce8c1aded20dbb69beb55556b08fd54603..ae7e7fc42427cf6845585ad1a2b7b6628a2e3b39 100644 (file)
@@ -132,11 +132,16 @@ unlink($file);
                printf("[001] %s [%s] %s\n",
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
-
-       @unlink($file);
-       $db->exec('DROP TABLE IF EXISTS test');
+       
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+@unlink(MySQLPDOTest::getTempDir() . DIRECTORY_SEPARATOR . 'pdoblob.tst');
+?>
 --EXPECTF--
 Emulated PS...
 Native PS...
index 2914583f6b08805148113f6983073f67963d4ea8..96489ef8615181d9fa211a3c4aff0fb5a9429004 100644 (file)
@@ -87,5 +87,12 @@ MySQLPDOTest::skip();
        }
 
        print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index c96da1f347958ff9e04b0bc893f2600bd0979cea..455b17d1efc9e5ca49599eadfb8c688ad5192eb0 100644 (file)
@@ -142,10 +142,14 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Testing emulated PS...
 Buffered...
index a575014c729d27e719643791f941c3aa285e8b11..aea272b1d29fb8865361e26812c3c9583dcefa64 100644 (file)
@@ -61,6 +61,11 @@ $db = MySQLPDOTest::factory();
        $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 in = 0 -> id = 1 (integer) / label = 'a' (string)
 in = 0 -> id = 2 (integer) / label = 'b' (string)
index 508ba0a3ef7049915efbb54386aeedd0deaef264..85985dde891202b38d945a164688948505c69605 100644 (file)
@@ -52,9 +52,13 @@ $db = MySQLPDOTest::factory();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Testing emulated PS...
 int(3)
index 877200631c8f637c6a52740ee64717668474be5d..4d59e8c3b10e33a3dda5a5945e35dac16a570cdc 100644 (file)
@@ -40,8 +40,6 @@ $db = MySQLPDOTest::factory();
                $stmt->execute();
                var_dump($stmt->errorCode());
 
-
-
        } catch (PDOException $e) {
                printf("[003] %s [%s] %s\n",
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
index a23952106ea38635d7844f0d47a6663ff3320f72..d5a348957fe4c8e96851fc3b5397b42c65f579ab 100644 (file)
@@ -59,11 +59,16 @@ $db = MySQLPDOTest::factory();
        }
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Testing emulated PS...
 array(3) {
   [0]=>
-  string(0) ""
+  %unicode|string%(0) ""
   [1]=>
   NULL
   [2]=>
@@ -73,26 +78,26 @@ array(3) {
 Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
 array(3) {
   [0]=>
-  string(5) "42S02"
+  %unicode|string%(5) "42S02"
   [1]=>
   int(1146)
   [2]=>
-  string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+  %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
 }
 
 Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
 bool(false)
 array(3) {
   [0]=>
-  string(5) "42S02"
+  %unicode|string%(5) "42S02"
   [1]=>
   int(1146)
   [2]=>
-  string(%d) "Table '%s.test' doesn't exist"
+  %unicode|string%(%d) "Table '%s.test' doesn't exist"
 }
 array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
   [1]=>
   NULL
   [2]=>
@@ -104,7 +109,7 @@ Warning: PDO::prepare(): SQLSTATE[42S02]: Base table or view not found: 1146 Tab
 bool(false)
 array(3) {
   [0]=>
-  string(0) ""
+  %unicode|string%(0) ""
   [1]=>
   NULL
   [2]=>
@@ -114,18 +119,18 @@ array(3) {
 Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
 array(3) {
   [0]=>
-  string(5) "42S02"
+  %unicode|string%(5) "42S02"
   [1]=>
   int(1146)
   [2]=>
-  string(%d) "Table '%s.test' doesn't exist"
+  %unicode|string%(%d) "Table '%s.test' doesn't exist"
 }
 array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
   [1]=>
   int(1146)
   [2]=>
-  string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+  %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
 }
-done!
\ No newline at end of file
+done!
index fdf63ea14a90da416b213b3192bb141216d91389..928e90de621ce723cd1d5499633717f6de529913 100644 (file)
@@ -180,8 +180,12 @@ MySQLPDOTest::skip();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index f9e849dcbd6521ab79e50297bf479e930a4d9437..18ef17b7c2544b5d3db700ddd2501f1a56892f64 100644 (file)
@@ -113,9 +113,14 @@ if (version_compare(PHP_VERSION, '5.1.0', '<'))
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 Creating an object, serializing it and writing it to DB...
 myclass::singleton(Creating object)
@@ -125,25 +130,24 @@ myclass::serialize()
 Unserializing the previously serialized object...
 myclass::unserialize('Data from serialize')
 object(myclass)#4 (1) {
-  [u"myprotected":protected]=>
-  unicode(19) "a protected propery"
+  [%u|b%"myprotected":protected]=>
+  %unicode|string%(19) "a protected propery"
 }
 
 Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
 myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
-myclass::__construct(PDO shall not call __construct())
 object(myclass)#%d (1) {
-  [u"myprotected":protected]=>
-  unicode(19) "a protected propery"
+  [%u|b%"myprotected":protected]=>
+  %unicode|string%(19) "a protected propery"
 }
 
 Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
 myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
 myclass::__construct(PDO shall call __construct())
 object(myclass)#%d (2) {
-  [u"myprotected":protected]=>
-  unicode(19) "a protected propery"
-  [u"myobj"]=>
-  unicode(38) "C:7:"myclass":19:{Data from serialize}"
+  [%u|b%"myprotected":protected]=>
+  %unicode|string%(19) "a protected propery"
+  [%u|b%"myobj"]=>
+  %unicode|string%(38) "C:7:"myclass":19:{Data from serialize}"
 }
 done!
index ba29e6a53ec58321c68ee8844fccf9358de19106..e9b231cfdd9025aef45f37870acdd708896c0915 100644 (file)
@@ -80,17 +80,14 @@ object(myclass)#%d (0) {
 
 And now magic PDO using fetchAll(PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE)...
 myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
 object(myclass)#%d (0) {
 }
 myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct(NULL) - note that it must not be called when unserializing
 object(myclass)#%d (0) {
 }
 
 And now PDO using setFetchMode(PDO::FETCH:CLASS|PDO::FETCH_SERIALIZE) + fetch()...
 myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
 object(myclass)#%d (0) {
 }
 done!
index 881e6dc99081ad4811266ba22b6f61bd3ee2139b..067f9ca7046efd94f5e0a206bf19c0d2f1c02a82 100644 (file)
@@ -63,9 +63,13 @@ try {
                $e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo()));
 }
 
-$db->exec('DROP TABLE IF EXISTS test');
 print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 myclass::__set(id, -'1'-) 1
 myclass::__set(, -''-) 2
@@ -83,13 +87,13 @@ myclass::__set(null, -NULL-) 3
 myclass::__set(, -''-) 4
 myclass::__construct(2, 3): 12 / 4
 object(myclass)#%d (4) {
-  [u"set_calls":u"myclass":private]=>
+  [%u|b%"set_calls":"myclass":private]=>
   int(4)
-  [u"grp":protected]=>
+  [%u|b%"grp":protected]=>
   NULL
-  [u"id"]=>
-  string(1) "3"
-  [u"null"]=>
+  [%u|b%"id"]=>
+  %unicode|string%(1) "3"
+  [%u|b%"null"]=>
   NULL
 }
 done!
\ No newline at end of file
index f560023bba3bf1f4d98207c3d475f1deb0f0d2fc..91b5237ea8df514382c1ef01b47fdcc394e6aeb2 100644 (file)
@@ -49,14 +49,18 @@ MySQLPDOTest::skip();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Emulated Prepared Statements...
 array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
   [1]=>
   NULL
   [2]=>
@@ -65,13 +69,13 @@ array(3) {
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(3) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
   [1]=>
   NULL
   [2]=>
@@ -80,19 +84,19 @@ array(3) {
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(1) {
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 Native Prepared Statements...
 
 Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
 
-Fatal error: Call to a member function errorInfo() on a non-object in %s on line %d
\ No newline at end of file
+Fatal error: Call to a member function errorInfo() on a non-object in %s on line %d
index f491536abcb24abb8b0b736ac790556177b860ad..799624543141d8e18c33fcc18b9720a40aa9a532 100644 (file)
@@ -104,106 +104,110 @@ if (!MySQLPDOTest::isPDOMySQLnd())
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Emulated PS...
 array(1) {
   [0]=>
   array(1) {
-    ["_version"]=>
-    string(%d) "%s"
+    [%u|b%"_version"]=>
+    %unicode|string%(%d) "%s"
   }
 }
 bool(false)
 array(3) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
   }
   [1]=>
   array(1) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
   }
   [2]=>
   array(1) {
-    ["id"]=>
-    string(1) "3"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
   }
 }
 array(3) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "3"
-    ["label"]=>
-    string(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "c"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
   }
   [2]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 bool(false)
 array(1) {
   [0]=>
   array(1) {
-    ["_version"]=>
-    string(%d) "%s"
+    [%u|b%"_version"]=>
+    %unicode|string%(%d) "%s"
   }
 }
 bool(false)
 array(3) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
   }
   [1]=>
   array(1) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
   }
   [2]=>
   array(1) {
-    ["id"]=>
-    string(1) "3"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
   }
 }
 array(3) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "3"
-    ["label"]=>
-    string(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "c"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
   }
   [2]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 bool(false)
@@ -211,98 +215,98 @@ Native PS...
 array(1) {
   [0]=>
   array(1) {
-    ["_version"]=>
-    string(%d) "%s"
+    [%u|b%"_version"]=>
+    %unicode|string%(%d) "%s"
   }
 }
 bool(false)
 array(3) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
   }
   [1]=>
   array(1) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
   }
   [2]=>
   array(1) {
-    ["id"]=>
-    string(1) "3"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
   }
 }
 array(3) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "3"
-    ["label"]=>
-    string(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "c"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
   }
   [2]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 bool(false)
 array(1) {
   [0]=>
   array(1) {
-    ["_version"]=>
-    string(%d) "%s"
+    [%u|b%"_version"]=>
+    %unicode|string%(%d) "%s"
   }
 }
 bool(false)
 array(3) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
   }
   [1]=>
   array(1) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
   }
   [2]=>
   array(1) {
-    ["id"]=>
-    string(1) "3"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
   }
 }
 array(3) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "3"
-    ["label"]=>
-    string(1) "c"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "3"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "c"
   }
   [1]=>
   array(2) {
-    ["id"]=>
-    string(1) "2"
-    ["label"]=>
-    string(1) "b"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "b"
   }
   [2]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 bool(false)
index 8883b8496ba39bad2190e0560ee110d3fdfe368e..17e2412de101656decef8e4c874f2f5ea88830fa 100644 (file)
@@ -25,8 +25,12 @@ MySQLPDOTest::skip();
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index 0be9eacc768a5d51a0ec7e4f789e135d61420a23..f051403d82d9af193104e4e59671f00810cabc5c 100644 (file)
@@ -108,28 +108,32 @@ if (MYSQLPDOTest::isPDOMySQLnd())
                        $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
        }
 
-       $db->exec('DROP TABLE IF EXISTS test');
        print "done!";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
 --EXPECTF--
 Native PS...
 Buffered...
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 Unbuffered...
@@ -144,37 +148,37 @@ array(0) {
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 array(1) {
   [0]=>
   array(2) {
-    ["id"]=>
-    string(1) "1"
-    ["label"]=>
-    string(1) "a"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
+    [%u|b%"label"]=>
+    %unicode|string%(1) "a"
   }
 }
 done!
\ No newline at end of file
index 853f5a3855570ff3e9a824e06d6cd33b21bd5c61..c34f4a9d352ce6dacd5e0efdb0d21c17a8392377 100644 (file)
@@ -118,5 +118,6 @@ if ($version < 50000)
        }
 
        print "done!";
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index fbe0e1796537c6f36e07d584fbaffa76eff1c2d3..c83130d8defdbf8afeda42c4c7924645843b1546 100644 (file)
@@ -74,6 +74,12 @@ if (version_compare(PHP_VERSION, '5.0.0', '<'))
        $db->exec('DROP TABLE IF EXISTS test');
        print "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 __construct('%S', '%S', '%S')
 exec('DROP TABLE IF EXISTS test')
@@ -83,13 +89,13 @@ query('SELECT * FROM test ORDER BY id ASC')
 array(2) {
   [0]=>
   array(1) {
-    ["id"]=>
-    string(1) "1"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "1"
   }
   [1]=>
   array(1) {
-    ["id"]=>
-    string(1) "2"
+    [%u|b%"id"]=>
+    %unicode|string%(1) "2"
   }
 }
 bool(false)
index 7bd58232c56f6e27a19cb5c4826a836eb26b8893..3629ab9a34e53f1b6c34f5a256f0f46a96e9e012 100644 (file)
@@ -174,5 +174,11 @@ MySQLPDOTest::skip();
 
        echo "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 done!
index 9d521a1b857aab7d29e390cf4ed7922e195cc9a4..7c0ec3701a2993ea114c76181e1687790952afd9 100644 (file)
@@ -113,5 +113,11 @@ MySQLPDOTest::skip();
 
        echo "done!\n";
 ?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECTF--
 done!
\ No newline at end of file
index d07fe94326204cfcd53430c046a9ad058b5466f7..ff5b0e4c3ecd05c1337400cb393cc5823323b2ac 100644 (file)
@@ -17,7 +17,13 @@ $db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I',
 foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) {
        print_r($row);
 }
-
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
 --EXPECT--
 Array
 (
index c2e0a7937104b8084b885f8d10de29cbf5f1f77d..59842846d317c63dc118c21d529dc9c4fa0440b9 100644 (file)
@@ -25,15 +25,25 @@ var_dump($authstmt->fetch(PDO::FETCH_NUM));
 $info = $logstmt->errorInfo();
 unset($info[2]);
 var_dump($info);
---EXPECT--
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
+--EXPECTF--
 array(2) {
   [0]=>
-  string(7) "testing"
+  %unicode|string%(7) "testing"
   [1]=>
-  string(7) "testing"
+  %unicode|string%(7) "testing"
 }
 bool(true)
-array(1) {
+array(2) {
   [0]=>
-  string(5) "00000"
+  %unicode|string%(5) "00000"
+  [1]=>
+  NULL
 }
index fa22ecdcb6829afc6e89f77b31efccee4b46d4c8..04aa2c9552a735c07991ec2d9fced29dc2ea3b49 100644 (file)
@@ -32,21 +32,30 @@ $stmt = $db->prepare('select * from test') or var_dump($db->errorInfo());
 if($stmt) $stmt->execute();
 if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
---EXPECT--
+print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
+--EXPECTF--
 array(3) {
   [0]=>
   array(1) {
-    ["bar"]=>
-    string(3) "foo"
+    [%u|b%"bar"]=>
+    %unicode|string%(3) "foo"
   }
   [1]=>
   array(1) {
-    ["bar"]=>
+    [%u|b%"bar"]=>
     NULL
   }
   [2]=>
   array(1) {
-    ["bar"]=>
-    string(3) "qaz"
+    [%u|b%"bar"]=>
+    %unicode|string%(3) "qaz"
   }
 }
+done!
\ No newline at end of file