diff options
author | Ulf Wendel <uw@php.net> | 2009-11-04 12:33:49 +0000 |
---|---|---|
committer | Ulf Wendel <uw@php.net> | 2009-11-04 12:33:49 +0000 |
commit | e5e58ed47e99be9b2b304a90d8629e6fedab6822 (patch) | |
tree | d93179d6a35ca3db5010d0dea7bdb64b37fdba18 /ext | |
parent | e31e228a590b044d0055733737f883b9e8654663 (diff) | |
download | php-git-e5e58ed47e99be9b2b304a90d8629e6fedab6822.tar.gz |
Adding CLEAN sections and making tests portable between PHP 5 and PHP 6 by replacing string(n) with %unicode|string%(n) and similar.
Diffstat (limited to 'ext')
84 files changed, 812 insertions, 548 deletions
diff --git a/ext/pdo_mysql/tests/bug41125.phpt b/ext/pdo_mysql/tests/bug41125.phpt index 5889a4d291..cd913bbf3a 100644 --- a/ext/pdo_mysql/tests/bug41125.phpt +++ b/ext/pdo_mysql/tests/bug41125.phpt @@ -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 - - -------- diff --git a/ext/pdo_mysql/tests/bug44327.phpt b/ext/pdo_mysql/tests/bug44327.phpt index 1d853a7f85..f82c4302d8 100644 --- a/ext/pdo_mysql/tests/bug44327.phpt +++ b/ext/pdo_mysql/tests/bug44327.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/bug46292.phpt b/ext/pdo_mysql/tests/bug46292.phpt index 80423bc7a5..a0f9716c61 100644 --- a/ext/pdo_mysql/tests/bug46292.phpt +++ b/ext/pdo_mysql/tests/bug46292.phpt @@ -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 } } diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt index 88392ef32f..5969cae6a6 100644 --- a/ext/pdo_mysql/tests/bug_33689.phpt +++ b/ext/pdo_mysql/tests/bug_33689.phpt @@ -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 ( diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt index 524a3d0807..8e915332d4 100644 --- a/ext/pdo_mysql/tests/bug_37445.phpt +++ b/ext/pdo_mysql/tests/bug_37445.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt index 6a2124d3ba..47457180a5 100644 --- a/ext/pdo_mysql/tests/bug_39858.phpt +++ b/ext/pdo_mysql/tests/bug_39858.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/bug_41125.phpt b/ext/pdo_mysql/tests/bug_41125.phpt index 1f54cca5f1..a1d8dd1ae4 100644 --- a/ext/pdo_mysql/tests/bug_41125.phpt +++ b/ext/pdo_mysql/tests/bug_41125.phpt @@ -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) { diff --git a/ext/pdo_mysql/tests/bug_41698.phpt b/ext/pdo_mysql/tests/bug_41698.phpt index b2dee60d74..890ba77617 100644 --- a/ext/pdo_mysql/tests/bug_41698.phpt +++ b/ext/pdo_mysql/tests/bug_41698.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt index 60bdfee2ba..ee0cfe9ac2 100644 --- a/ext/pdo_mysql/tests/bug_41997.phpt +++ b/ext/pdo_mysql/tests/bug_41997.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/bug_42499.phpt b/ext/pdo_mysql/tests/bug_42499.phpt index 2be99b4ae8..dece019a9f 100644 --- a/ext/pdo_mysql/tests/bug_42499.phpt +++ b/ext/pdo_mysql/tests/bug_42499.phpt @@ -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" } } diff --git a/ext/pdo_mysql/tests/bug_44454.phpt b/ext/pdo_mysql/tests/bug_44454.phpt index e8f91a00aa..7ad7f85459 100644 --- a/ext/pdo_mysql/tests/bug_44454.phpt +++ b/ext/pdo_mysql/tests/bug_44454.phpt @@ -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... diff --git a/ext/pdo_mysql/tests/bug_44707.phpt b/ext/pdo_mysql/tests/bug_44707.phpt index d5d4539fcc..18c81040fe 100644 --- a/ext/pdo_mysql/tests/bug_44707.phpt +++ b/ext/pdo_mysql/tests/bug_44707.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/bug_pecl_12925.phpt b/ext/pdo_mysql/tests/bug_pecl_12925.phpt index 1d398ff854..1867868ecb 100644 --- a/ext/pdo_mysql/tests/bug_pecl_12925.phpt +++ b/ext/pdo_mysql/tests/bug_pecl_12925.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/bug_pecl_7976.phpt b/ext/pdo_mysql/tests/bug_pecl_7976.phpt index d92ed5e900..5f585bd013 100644 --- a/ext/pdo_mysql/tests/bug_pecl_7976.phpt +++ b/ext/pdo_mysql/tests/bug_pecl_7976.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc index aa98d1464a..7367919338 100644 --- a/ext/pdo_mysql/tests/mysql_pdo_test.inc +++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt index 8602a4971c..fa4bbafd85 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt index 5bd824b812..14f81a66f1 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt index 8bd714d698..b0959a3ac9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt index 8a8e347a63..b4ee6ea7d9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt @@ -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' diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt index 470605a6a3..7e92ff2e9a 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt index b48952875e..b1e5507f67 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt index 7d35ead7ae..618d9e65e4 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt index e3f21fbaf1..2d939635c8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt index 038df3cdbc..187f9ec232 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt index 0c156e4d1b..8661dda597 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt index 3b2b0929e4..b9a4fc934d 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt index 8d086b7cc1..89e6f386e5 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt @@ -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" diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt index 9ba8dee85f..115103df75 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt index 9e938ef6a9..cdc0b26431 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt index 07bb8c39f5..a59a6b0cc2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt index d077f6ebfe..631a918dd0 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt @@ -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" } } diff --git a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt index 209bf3d89d..8871a3170a 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt index 18506acef9..899231a217 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt index 056c0e0231..e213f66ea9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt index 35056a74d8..b970c4ef94 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt index 8829dc448a..93e1fbf1a2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt index 5ca5f44792..381a2b51df 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt index 00a2de1692..2e80053556 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt index ecfa502437..1310c0e643 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt index a759f72cd4..ef85fabe6f 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt @@ -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. diff --git a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt index a8cbde6ea6..da886390c0 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt index 74f17d5984..c992d3acf9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt b/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt index 552128cae1..2bb5573f3b 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt index 2a892a17de..eb0fff13e6 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt @@ -92,5 +92,6 @@ MySQLPDOTest::skip(); } print "done!"; +?> --EXPECTF-- done!
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt index 30e7bda479..a570c1fd49 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt @@ -26,5 +26,6 @@ $db = MySQLPDOTest::factory(); } print "done!"; +?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt index fa942f3858..4447146eef 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt index 1f333b9a99..c382025ba7 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt index be83446c85..e8f7d39840 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt index 1f8a4c2c3f..b8b77ff5db 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt @@ -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 ( diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt index 54257be42e..ba5142a0c8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt @@ -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) { } diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt index 1d5f301608..b9027c8980 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt @@ -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]=> diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt index 33c699c15f..8c367af249 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt @@ -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 ( diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt index b497268f99..57a4529ac2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt @@ -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]=> diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt index a84c8d56d2..c9d122a813 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt index c8d1a5ba83..90cedef561 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt index 6f673c78b2..c4a74eadfa 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt index aafad7085a..0f8c8880e3 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt index 358d4a780d..193b1a159c 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt index 394ed4f45d..dd4920e39d 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt index 993ea0447d..70b2f3fa25 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt @@ -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... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt index 64d4df0641..9421f62eea 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt index 6dc557d14f..1c62d77314 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt @@ -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... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt index 88b847ce8c..ae7e7fc424 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt @@ -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... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt index 2914583f6b..96489ef861 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt index c96da1f347..455b17d1ef 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt @@ -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... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt index a575014c72..aea272b1d2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt index 508ba0a3ef..85985dde89 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt index 877200631c..4d59e8c3b1 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt @@ -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())); diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt index a23952106e..d5a348957f 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt index fdf63ea14a..928e90de62 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt index f9e849dcbd..18ef17b7c2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt index ba29e6a53e..e9b231cfdd 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt index 881e6dc990..067f9ca704 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt index f560023bba..91b5237ea8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt index f491536abc..7996245431 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt index 8883b8496b..17e2412de1 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt index 0be9eacc76..f051403d82 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt index 853f5a3855..c34f4a9d35 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt @@ -118,5 +118,6 @@ if ($version < 50000) } print "done!"; +?> --EXPECTF-- done!
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt index fbe0e17965..c83130d8de 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt @@ -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) diff --git a/ext/pdo_mysql/tests/pdo_mysql_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_types.phpt index 7bd58232c5..3629ab9a34 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_types.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_types.phpt @@ -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! diff --git a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt index 9d521a1b85..7c0ec3701a 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt @@ -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 diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt index d07fe94326..ff5b0e4c3e 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt @@ -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 ( diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt index c2e0a79371..59842846d3 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt @@ -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 } diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt index fa22ecdcb6..04aa2c9552 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt @@ -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 |