From f3280f70fb0c86f18e8325e8f3d9cf1739b5b1fd Mon Sep 17 00:00:00 2001 From: SakiTakamachi Date: Mon, 30 Oct 2023 03:32:56 +0900 Subject: [PATCH] Optimized pdo_mysql tests --- ext/pdo_mysql/tests/bug41125.phpt | 8 ++- ext/pdo_mysql/tests/bug44327.phpt | 10 ++-- ext/pdo_mysql/tests/bug46292.phpt | 6 +-- ext/pdo_mysql/tests/bug53551.phpt | 7 ++- ext/pdo_mysql/tests/bug53782.phpt | 16 ++---- ext/pdo_mysql/tests/bug54929.phpt | 8 ++- ext/pdo_mysql/tests/bug63176.phpt | 5 +- ext/pdo_mysql/tests/bug63185.phpt | 7 ++- ext/pdo_mysql/tests/bug66141.phpt | 4 +- ext/pdo_mysql/tests/bug66528.phpt | 7 ++- ext/pdo_mysql/tests/bug66878.phpt | 4 +- ext/pdo_mysql/tests/bug67004.phpt | 4 +- ext/pdo_mysql/tests/bug68371.phpt | 4 +- ext/pdo_mysql/tests/bug70066.phpt | 5 +- ext/pdo_mysql/tests/bug70272.phpt | 6 +-- ext/pdo_mysql/tests/bug70389.phpt | 4 +- ext/pdo_mysql/tests/bug70862.phpt | 9 ++-- ext/pdo_mysql/tests/bug71145.phpt | 4 +- ext/pdo_mysql/tests/bug71569.phpt | 4 +- ext/pdo_mysql/tests/bug75177.phpt | 8 +-- ext/pdo_mysql/tests/bug76815.phpt | 6 +-- ext/pdo_mysql/tests/bug77289.phpt | 4 +- ext/pdo_mysql/tests/bug78152.phpt | 6 +-- ext/pdo_mysql/tests/bug79132.phpt | 4 +- ext/pdo_mysql/tests/bug79375.phpt | 7 ++- ext/pdo_mysql/tests/bug79596.phpt | 9 ++-- ext/pdo_mysql/tests/bug79872.phpt | 4 +- ext/pdo_mysql/tests/bug80458.phpt | 7 ++- ext/pdo_mysql/tests/bug80808.phpt | 9 +++- ext/pdo_mysql/tests/bug80908.phpt | 7 ++- ext/pdo_mysql/tests/bug81037.phpt | 7 ++- ext/pdo_mysql/tests/bug_33689.phpt | 13 ++--- ext/pdo_mysql/tests/bug_37445.phpt | 10 ++-- ext/pdo_mysql/tests/bug_38546.phpt | 13 ++--- ext/pdo_mysql/tests/bug_39483.phpt | 10 ++-- ext/pdo_mysql/tests/bug_39858.phpt | 9 ++-- ext/pdo_mysql/tests/bug_41125.phpt | 9 ++-- ext/pdo_mysql/tests/bug_41698.phpt | 16 +++--- ext/pdo_mysql/tests/bug_41997.phpt | 6 +-- ext/pdo_mysql/tests/bug_42499.phpt | 11 ++-- ext/pdo_mysql/tests/bug_43371.phpt | 4 +- ext/pdo_mysql/tests/bug_44454.phpt | 16 +++--- ext/pdo_mysql/tests/bug_44707.phpt | 14 ++--- ext/pdo_mysql/tests/bug_45120.phpt | 11 ++-- ext/pdo_mysql/tests/bug_50323.phpt | 14 +++-- ext/pdo_mysql/tests/bug_51670.phpt | 10 ++-- ext/pdo_mysql/tests/bug_61207.phpt | 7 ++- ext/pdo_mysql/tests/bug_61411.phpt | 7 ++- ext/pdo_mysql/tests/bug_61755.phpt | 10 ++-- ext/pdo_mysql/tests/bug_74376.phpt | 5 +- ext/pdo_mysql/tests/bug_pecl_12925.phpt | 11 ++-- ext/pdo_mysql/tests/bug_pecl_7976.phpt | 9 ++-- ext/pdo_mysql/tests/change_column_count.phpt | 7 ++- ext/pdo_mysql/tests/common.phpt | 27 ---------- ext/pdo_mysql/tests/config.inc | 52 ------------------- ext/pdo_mysql/tests/gh11550.phpt | 7 ++- .../tests/{gh-11587.phpt => gh11587.phpt} | 8 +-- ext/pdo_mysql/tests/inc/config.inc | 17 ++++++ ext/pdo_mysql/tests/inc/init.inc | 45 ++++++++++++++++ .../tests/{ => inc}/mysql_pdo_test.inc | 34 ++++++++---- .../{ => inc}/skipifinfilenotallowed.inc | 0 ext/pdo_mysql/tests/last_insert_id.phpt | 15 +++--- ext/pdo_mysql/tests/native_types.phpt | 8 +-- .../tests/pdo_mysql___construct.phpt | 4 +- .../tests/pdo_mysql___construct_ini.phpt | 4 +- .../tests/pdo_mysql___construct_options.phpt | 4 +- ...do_mysql___construct_options_libmysql.phpt | 4 +- .../tests/pdo_mysql___construct_uri.phpt | 4 +- .../tests/pdo_mysql_attr_autocommit.phpt | 7 ++- ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt | 7 ++- .../tests/pdo_mysql_attr_client_version.phpt | 5 +- .../pdo_mysql_attr_connection_status.phpt | 5 +- .../tests/pdo_mysql_attr_driver_name.phpt | 5 +- .../tests/pdo_mysql_attr_errmode.phpt | 5 +- .../pdo_mysql_attr_fetch_table_names.phpt | 9 +++- .../tests/pdo_mysql_attr_init_command.phpt | 5 +- .../tests/pdo_mysql_attr_max_buffer_size.phpt | 9 ++-- .../pdo_mysql_attr_multi_statements.phpt | 5 +- .../tests/pdo_mysql_attr_oracle_nulls.phpt | 9 +++- .../tests/pdo_mysql_attr_prefetch.phpt | 5 +- .../tests/pdo_mysql_attr_server_info.phpt | 5 +- .../tests/pdo_mysql_attr_server_version.phpt | 5 +- .../tests/pdo_mysql_attr_statement_class.phpt | 10 ++-- .../tests/pdo_mysql_begintransaction.phpt | 11 ++-- ext/pdo_mysql/tests/pdo_mysql_bit.phpt | 9 ++-- .../tests/pdo_mysql_class_constants.phpt | 4 +- .../tests/pdo_mysql_closecursor_error.phpt | 4 +- ext/pdo_mysql/tests/pdo_mysql_commit.phpt | 11 ++-- .../tests/pdo_mysql_connect_attr.phpt | 8 +-- .../tests/pdo_mysql_connect_charset.phpt | 4 +- ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt | 7 ++- ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt | 7 ++- ext/pdo_mysql/tests/pdo_mysql_exec.phpt | 10 ++-- ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt | 6 +-- .../tests/pdo_mysql_exec_load_data.phpt | 9 ++-- .../tests/pdo_mysql_exec_select.phpt | 9 ++-- ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt | 5 +- .../tests/pdo_mysql_get_attribute.phpt | 11 ++-- .../tests/pdo_mysql_inTransaction.phpt | 4 +- ext/pdo_mysql/tests/pdo_mysql_interface.phpt | 9 ++-- .../tests/pdo_mysql_last_insert_id.phpt | 7 ++- .../pdo_mysql_local_infile_default_off.phpt | 5 +- ..._mysql_local_infile_directory_allowed.phpt | 14 ++--- ...o_mysql_local_infile_directory_denied.phpt | 14 ++--- ...file_overrides_local_infile_directory.phpt | 14 ++--- .../tests/pdo_mysql_local_infile_set_on.phpt | 5 +- .../pdo_mysql_multi_stmt_nextrowset.phpt | 6 +-- .../tests/pdo_mysql_param_str_natl.phpt | 13 ++--- ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt | 4 +- ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt | 5 +- .../tests/pdo_mysql_prepare_emulated.phpt | 10 ++-- .../pdo_mysql_prepare_emulated_anonymous.phpt | 10 ++-- ...epare_emulated_placeholder_everywhere.phpt | 9 ++-- .../pdo_mysql_prepare_match_against.phpt | 9 ++-- .../tests/pdo_mysql_prepare_native.phpt | 10 ++-- .../pdo_mysql_prepare_native_clear_error.phpt | 10 ++-- .../pdo_mysql_prepare_native_column.phpt | 10 ++-- ..._prepare_native_dup_named_placeholder.phpt | 10 ++-- .../pdo_mysql_prepare_native_mixed_style.phpt | 7 ++- ...ysql_prepare_native_named_placeholder.phpt | 10 ++-- ...prepare_native_placeholder_everywhere.phpt | 10 ++-- ext/pdo_mysql/tests/pdo_mysql_quote.phpt | 4 +- ext/pdo_mysql/tests/pdo_mysql_rollback.phpt | 13 ++--- .../tests/pdo_mysql_stmt_bindcolumn.phpt | 10 ++-- .../tests/pdo_mysql_stmt_bindparam.phpt | 6 +-- .../tests/pdo_mysql_stmt_bindparam_types.phpt | 7 ++- .../tests/pdo_mysql_stmt_bindvalue.phpt | 7 ++- .../tests/pdo_mysql_stmt_blobfromsteam.phpt | 9 ++-- ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt | 9 ++-- .../tests/pdo_mysql_stmt_closecursor.phpt | 10 ++-- .../pdo_mysql_stmt_closecursor_empty.phpt | 7 ++- .../tests/pdo_mysql_stmt_columncount.phpt | 7 ++- .../tests/pdo_mysql_stmt_errorcode.phpt | 5 +- .../tests/pdo_mysql_stmt_errorinfo.phpt | 7 ++- .../pdo_mysql_stmt_fetch_non_select.phpt | 6 +-- .../tests/pdo_mysql_stmt_fetch_serialize.phpt | 9 ++-- ...pdo_mysql_stmt_fetch_serialize_simple.phpt | 9 +++- .../tests/pdo_mysql_stmt_fetchobject.phpt | 8 +-- .../pdo_mysql_stmt_fetchobject_ctor_args.phpt | 8 +-- .../tests/pdo_mysql_stmt_getcolumnmeta.phpt | 9 +++- .../tests/pdo_mysql_stmt_multiquery.phpt | 6 +-- .../tests/pdo_mysql_stmt_nextrowset.phpt | 6 +-- .../tests/pdo_mysql_stmt_rowcount.phpt | 6 +-- .../tests/pdo_mysql_stmt_unbuffered_2050.phpt | 7 ++- .../pdo_mysql_stmt_variable_columncount.phpt | 8 +-- ext/pdo_mysql/tests/pdo_mysql_subclass.phpt | 9 ++-- ext/pdo_mysql/tests/pdo_mysql_types.phpt | 9 ++-- .../tests/pdo_mysql_types_zerofill.phpt | 9 ++-- ext/pdo_mysql/tests/pecl_bug_5200.phpt | 15 +++--- ext/pdo_mysql/tests/pecl_bug_5780.phpt | 14 +++-- ext/pdo_mysql/tests/pecl_bug_5802.phpt | 15 +++--- ext/pdo_mysql/tests/show_tables.phpt | 10 ++-- ext/pdo_mysql/tests/table.inc | 9 ---- ext/pdo_mysql/tests/unsigned_bigint.phpt | 10 ++-- 154 files changed, 617 insertions(+), 737 deletions(-) delete mode 100644 ext/pdo_mysql/tests/common.phpt delete mode 100644 ext/pdo_mysql/tests/config.inc rename ext/pdo_mysql/tests/{gh-11587.phpt => gh11587.phpt} (90%) create mode 100644 ext/pdo_mysql/tests/inc/config.inc create mode 100644 ext/pdo_mysql/tests/inc/init.inc rename ext/pdo_mysql/tests/{ => inc}/mysql_pdo_test.inc (80%) rename ext/pdo_mysql/tests/{ => inc}/skipifinfilenotallowed.inc (100%) delete mode 100644 ext/pdo_mysql/tests/table.inc diff --git a/ext/pdo_mysql/tests/bug41125.phpt b/ext/pdo_mysql/tests/bug41125.phpt index fd854b5e9c558..bf41bd0917ebd 100644 --- a/ext/pdo_mysql/tests/bug41125.phpt +++ b/ext/pdo_mysql/tests/bug41125.phpt @@ -4,16 +4,14 @@ Bug #41125 (PDO mysql + quote() + prepare() can result in seg fault) pdo_mysql --SKIPIF-- --FILE-- quote('%' . $search . '%'); diff --git a/ext/pdo_mysql/tests/bug44327.phpt b/ext/pdo_mysql/tests/bug44327.phpt index 40be22e592ffa..beba5b0b57198 100644 --- a/ext/pdo_mysql/tests/bug44327.phpt +++ b/ext/pdo_mysql/tests/bug44327.phpt @@ -4,13 +4,12 @@ Bug #44327 (PDORow::queryString property & numeric offsets / Crash) pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -41,6 +40,11 @@ $db = MySQLPDOTest::factory(); $row = $stmt->fetch(); var_dump($row->queryString); +?> +--CLEAN-- + --EXPECTF-- object(PDORow)#%d (2) { diff --git a/ext/pdo_mysql/tests/bug46292.phpt b/ext/pdo_mysql/tests/bug46292.phpt index 8664df7ddebcb..432a6f194327e 100644 --- a/ext/pdo_mysql/tests/bug46292.phpt +++ b/ext/pdo_mysql/tests/bug46292.phpt @@ -4,13 +4,13 @@ Bug #46292 (PDO::setFetchMode() shouldn't requires the 2nd arg when using FETCH_ pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS testz'); ?> diff --git a/ext/pdo_mysql/tests/bug53551.phpt b/ext/pdo_mysql/tests/bug53551.phpt index ab394e557a76c..ec04d1be2fdde 100644 --- a/ext/pdo_mysql/tests/bug53551.phpt +++ b/ext/pdo_mysql/tests/bug53551.phpt @@ -4,13 +4,12 @@ Bug #44327 (PDORow::queryString property & numeric offsets / Crash) pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_EMULATE_PREPARES, 0); @@ -43,7 +42,7 @@ echo "\ndone\n"; ?> --CLEAN-- exec('DROP TABLE IF EXISTS bug53551'); ?> diff --git a/ext/pdo_mysql/tests/bug53782.phpt b/ext/pdo_mysql/tests/bug53782.phpt index e520b15fc100b..93e1433a52f59 100644 --- a/ext/pdo_mysql/tests/bug53782.phpt +++ b/ext/pdo_mysql/tests/bug53782.phpt @@ -1,19 +1,16 @@ --TEST-- PDO MySQL Bug #53782 (foreach throws irrelevant exception) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -31,11 +28,6 @@ foreach ($res as $k => $v) { echo "DONE"; ?> ---CLEAN-- - --EXPECTF-- Caught: SQLSTATE[42000]: %s Value: 0 diff --git a/ext/pdo_mysql/tests/bug54929.phpt b/ext/pdo_mysql/tests/bug54929.phpt index 27e228b25af60..f9c5a275b0572 100644 --- a/ext/pdo_mysql/tests/bug54929.phpt +++ b/ext/pdo_mysql/tests/bug54929.phpt @@ -4,16 +4,14 @@ Bug #54929 (Parse error with single quote in sql comment (pdo-mysql)) pdo_mysql --SKIPIF-- --FILE-- --FILE-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -45,7 +44,7 @@ var_dump($st->fetchAll()); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS test_procedure_error_at_second'); ?> diff --git a/ext/pdo_mysql/tests/bug66141.phpt b/ext/pdo_mysql/tests/bug66141.phpt index 4accc673dcdc0..2c8db83dde4e6 100644 --- a/ext/pdo_mysql/tests/bug66141.phpt +++ b/ext/pdo_mysql/tests/bug66141.phpt @@ -4,12 +4,12 @@ Bug #66141 (mysqlnd quote function is wrong with NO_BACKSLASH_ESCAPES after fail pdo_mysql --SKIPIF-- --FILE-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -43,7 +42,7 @@ try { ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug66878.phpt b/ext/pdo_mysql/tests/bug66878.phpt index 44c640ba0c2c6..ff2c2c1dbcabc 100644 --- a/ext/pdo_mysql/tests/bug66878.phpt +++ b/ext/pdo_mysql/tests/bug66878.phpt @@ -4,12 +4,12 @@ Bug #66878: Multiple rowsets not returned unless PDO statement object is unset() pdo_mysql --SKIPIF-- --FILE-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); diff --git a/ext/pdo_mysql/tests/bug68371.phpt b/ext/pdo_mysql/tests/bug68371.phpt index 375011af33ea7..6834b37568a60 100644 --- a/ext/pdo_mysql/tests/bug68371.phpt +++ b/ext/pdo_mysql/tests/bug68371.phpt @@ -4,12 +4,12 @@ PDO MySQL Bug #38671 (PDO#getAttribute() cannot be called with platform-specific pdo_mysql --SKIPIF-- --FILE-- setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo_mysql/tests/bug70066.phpt b/ext/pdo_mysql/tests/bug70066.phpt index fefec5ec56da1..0195513a5ba9d 100644 --- a/ext/pdo_mysql/tests/bug70066.phpt +++ b/ext/pdo_mysql/tests/bug70066.phpt @@ -1,17 +1,16 @@ --TEST-- Bug #70066: Unexpected "Cannot execute queries while other unbuffered queries" --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo_mysql/tests/bug70272.phpt b/ext/pdo_mysql/tests/bug70272.phpt index b3f4a485bc8de..ca53368d10c78 100644 --- a/ext/pdo_mysql/tests/bug70272.phpt +++ b/ext/pdo_mysql/tests/bug70272.phpt @@ -4,7 +4,7 @@ Bug #70272 (Segfault in pdo_mysql) pdo_mysql --SKIPIF-- --INI-- @@ -13,11 +13,11 @@ report_memleaks=off a = &$a; -require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $dummy = new StdClass(); -$db = PDOTest::test_factory(__DIR__ . '/common.phpt'); +$db = MySQLPDOTest::factory(); $dummy = NULL; $a->c = $db; diff --git a/ext/pdo_mysql/tests/bug70389.phpt b/ext/pdo_mysql/tests/bug70389.phpt index 1a50f2b8d8cd0..ff9279813fba1 100644 --- a/ext/pdo_mysql/tests/bug70389.phpt +++ b/ext/pdo_mysql/tests/bug70389.phpt @@ -4,12 +4,12 @@ Bug #70389 (PDO constructor changes unrelated variables) pdo_mysql --SKIPIF-- --FILE-- true, PDO::MYSQL_ATTR_LOCAL_INFILE => true, diff --git a/ext/pdo_mysql/tests/bug70862.phpt b/ext/pdo_mysql/tests/bug70862.phpt index 95e68896eacdf..0d513e3ec141f 100644 --- a/ext/pdo_mysql/tests/bug70862.phpt +++ b/ext/pdo_mysql/tests/bug70862.phpt @@ -4,12 +4,12 @@ MySQL Prepared Statements and BLOBs pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS test'); @@ -39,9 +39,8 @@ MySQLPDOTest::skip(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- string(0) "" diff --git a/ext/pdo_mysql/tests/bug71145.phpt b/ext/pdo_mysql/tests/bug71145.phpt index 97883072ea3a1..8a62cfc5b3c62 100644 --- a/ext/pdo_mysql/tests/bug71145.phpt +++ b/ext/pdo_mysql/tests/bug71145.phpt @@ -4,13 +4,13 @@ Bug #71145: Multiple statements in init command triggers unbuffered query error pdo_mysql --SKIPIF-- --FILE-- PDO::ERRMODE_EXCEPTION, diff --git a/ext/pdo_mysql/tests/bug71569.phpt b/ext/pdo_mysql/tests/bug71569.phpt index aade487ed033d..5a1880c8fb6e2 100644 --- a/ext/pdo_mysql/tests/bug71569.phpt +++ b/ext/pdo_mysql/tests/bug71569.phpt @@ -4,12 +4,12 @@ Bug #71569 (#70389 fix causes segmentation fault) pdo_mysql --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug76815.phpt b/ext/pdo_mysql/tests/bug76815.phpt index e991e7aec0be4..9f0c1df147280 100644 --- a/ext/pdo_mysql/tests/bug76815.phpt +++ b/ext/pdo_mysql/tests/bug76815.phpt @@ -4,12 +4,12 @@ Bug #76815: PDOStatement cannot be GCed/closeCursor-ed when a PROCEDURE resultse pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -31,7 +31,7 @@ echo "Ok.\n"; ?> --CLEAN-- query('DROP FUNCTION IF EXISTS tst'); $pdo->query('DROP PROCEDURE IF EXISTS tst2'); diff --git a/ext/pdo_mysql/tests/bug77289.phpt b/ext/pdo_mysql/tests/bug77289.phpt index 8c847a59c8f3e..1a00278ae0a0e 100644 --- a/ext/pdo_mysql/tests/bug77289.phpt +++ b/ext/pdo_mysql/tests/bug77289.phpt @@ -4,12 +4,12 @@ Bug #77289: PDO MySQL segfaults with persistent connection pdo_mysql --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/bug79132.phpt b/ext/pdo_mysql/tests/bug79132.phpt index 0761c23a02fc3..11b38c587ecb6 100644 --- a/ext/pdo_mysql/tests/bug79132.phpt +++ b/ext/pdo_mysql/tests/bug79132.phpt @@ -4,12 +4,12 @@ Bug #79132: PDO re-uses parameter values from earlier calls to execute() pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo_mysql/tests/bug79375.phpt b/ext/pdo_mysql/tests/bug79375.phpt index 8f72a594aefe4..935c22b3e0a16 100644 --- a/ext/pdo_mysql/tests/bug79375.phpt +++ b/ext/pdo_mysql/tests/bug79375.phpt @@ -1,17 +1,16 @@ --TEST-- Bug #79375: mysqli_store_result does not report error from lock wait timeout --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug79596.phpt b/ext/pdo_mysql/tests/bug79596.phpt index 5b0d62d3f278f..6608c4dd496c8 100644 --- a/ext/pdo_mysql/tests/bug79596.phpt +++ b/ext/pdo_mysql/tests/bug79596.phpt @@ -4,14 +4,14 @@ Bug #79596 (MySQL FLOAT truncates to int some locales) pdo_mysql --SKIPIF-- --FILE-- query('SELECT broken FROM bug79596')->fetchColumn(0)); ?> --CLEAN-- exec("DROP TABLE IF EXISTS bug79596"); ?> diff --git a/ext/pdo_mysql/tests/bug79872.phpt b/ext/pdo_mysql/tests/bug79872.phpt index 7713370dee3be..836c30b1e7c77 100644 --- a/ext/pdo_mysql/tests/bug79872.phpt +++ b/ext/pdo_mysql/tests/bug79872.phpt @@ -4,12 +4,12 @@ Bug #79872: Can't execute query with pending result sets pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo_mysql/tests/bug80458.phpt b/ext/pdo_mysql/tests/bug80458.phpt index 558d029402c68..08e9729db81d7 100644 --- a/ext/pdo_mysql/tests/bug80458.phpt +++ b/ext/pdo_mysql/tests/bug80458.phpt @@ -1,16 +1,15 @@ --TEST-- Bug #80458 PDOStatement::fetchAll() throws for upsert queries --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -114,7 +113,7 @@ var_dump($stmt->fetchAll()); ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug80808.phpt b/ext/pdo_mysql/tests/bug80808.phpt index 7757a9c2311a1..bc151b4ce9de4 100644 --- a/ext/pdo_mysql/tests/bug80808.phpt +++ b/ext/pdo_mysql/tests/bug80808.phpt @@ -4,13 +4,13 @@ Bug #80808: PDO returns ZEROFILL integers without leading zeros pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS test'); @@ -22,6 +22,11 @@ var_dump($pdo->query('SELECT * FROM test')->fetchColumn(0)); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); var_dump($pdo->query('SELECT * FROM test')->fetchColumn(0)); +?> +--CLEAN-- + --EXPECT-- string(4) "0800" diff --git a/ext/pdo_mysql/tests/bug80908.phpt b/ext/pdo_mysql/tests/bug80908.phpt index c8155034efc24..59ae13a930235 100644 --- a/ext/pdo_mysql/tests/bug80908.phpt +++ b/ext/pdo_mysql/tests/bug80908.phpt @@ -1,16 +1,15 @@ --TEST-- Bug #80908: pdo_mysql lastInsertId() return wrong, when table id bigger than the maximum value of int64 --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug81037.phpt b/ext/pdo_mysql/tests/bug81037.phpt index 73cc757a4cfbd..f074327816a1f 100644 --- a/ext/pdo_mysql/tests/bug81037.phpt +++ b/ext/pdo_mysql/tests/bug81037.phpt @@ -1,16 +1,15 @@ --TEST-- Bug #81037 PDO discards error message text from prepared statement --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -29,7 +28,7 @@ $data = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt index d05598e11002a..6e52b10454c25 100644 --- a/ext/pdo_mysql/tests/bug_33689.phpt +++ b/ext/pdo_mysql/tests/bug_33689.phpt @@ -1,19 +1,16 @@ --TEST-- PDO MySQL Bug #33689 (query() execute() and fetch() return false on valid select queries) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec('CREATE TABLE test (bar INT NOT NULL)'); $db->exec('INSERT INTO test VALUES(1)'); @@ -39,7 +36,7 @@ print_r($tmp); ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt index 6bf75999c683d..5a451e0da4071 100644 --- a/ext/pdo_mysql/tests/bug_37445.phpt +++ b/ext/pdo_mysql/tests/bug_37445.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL Bug #37445 (Premature stmt object destruction) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO :: ATTR_EMULATE_PREPARES, true); $stmt = $db->prepare("SELECT 1"); diff --git a/ext/pdo_mysql/tests/bug_38546.phpt b/ext/pdo_mysql/tests/bug_38546.phpt index 2fe8a694656b0..e8b78bc11a8db 100644 --- a/ext/pdo_mysql/tests/bug_38546.phpt +++ b/ext/pdo_mysql/tests/bug_38546.phpt @@ -1,19 +1,16 @@ --TEST-- PDO MySQL Bug #38546 (bindParam incorrect processing of bool types) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_EMULATE_PREPARES, false); @@ -191,7 +188,7 @@ foreach ($db->query('SELECT * from test') as $row) { ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/bug_39483.phpt b/ext/pdo_mysql/tests/bug_39483.phpt index 810251e96cba7..0bdc029211332 100644 --- a/ext/pdo_mysql/tests/bug_39483.phpt +++ b/ext/pdo_mysql/tests/bug_39483.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL Bug #39483 (Problem with handling of \ char in prepared statements) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE); $stmt = $db->prepare('SELECT UPPER(\'\0:D\0\'),?'); diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt index c56fbf72fe28d..b62fd4658a94e 100644 --- a/ext/pdo_mysql/tests/bug_39858.phpt +++ b/ext/pdo_mysql/tests/bug_39858.phpt @@ -1,14 +1,13 @@ --TEST-- Bug #39858 (Lost connection to MySQL server during query by a repeated call stored proced) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) @@ -21,7 +20,7 @@ if ($version < 50000) ?> --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -65,7 +64,7 @@ print "done!"; ?> --CLEAN-- exec("DROP PROCEDURE IF EXISTS p"); ?> diff --git a/ext/pdo_mysql/tests/bug_41125.phpt b/ext/pdo_mysql/tests/bug_41125.phpt index b5f58e990088d..25e70f60623b7 100644 --- a/ext/pdo_mysql/tests/bug_41125.phpt +++ b/ext/pdo_mysql/tests/bug_41125.phpt @@ -4,7 +4,7 @@ Bug #41125 (PDO mysql + quote() + prepare() can result in segfault) pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); $db->exec("DROP TABLE IF EXISTS test"); @@ -37,9 +37,8 @@ print "done!"; ?> --CLEAN-- exec("DROP TABLE IF EXISTS test"); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- array(0) { diff --git a/ext/pdo_mysql/tests/bug_41698.phpt b/ext/pdo_mysql/tests/bug_41698.phpt index 9df6d47d134be..b9ab7fb02d5fc 100644 --- a/ext/pdo_mysql/tests/bug_41698.phpt +++ b/ext/pdo_mysql/tests/bug_41698.phpt @@ -1,19 +1,16 @@ --TEST-- PDO MySQL Bug #41698 (float parameters truncated to integer in prepared statements) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- prepare('INSERT INTO test VALUES(?)'); $stmt->execute(array($value)); var_dump($db->query('SELECT * from test')->fetchAll(PDO::FETCH_ASSOC)); ?> +--CLEAN-- + --EXPECT-- array(2) { [0]=> diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt index 51f41eb6d8c26..08882f6f86636 100644 --- a/ext/pdo_mysql/tests/bug_41997.phpt +++ b/ext/pdo_mysql/tests/bug_41997.phpt @@ -4,7 +4,7 @@ PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks futur pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -40,7 +40,7 @@ print "done!"; ?> --CLEAN-- exec("DROP PROCEDURE IF EXISTS p"); ?> diff --git a/ext/pdo_mysql/tests/bug_42499.phpt b/ext/pdo_mysql/tests/bug_42499.phpt index f2b907595bb23..e060ffb2c7669 100644 --- a/ext/pdo_mysql/tests/bug_42499.phpt +++ b/ext/pdo_mysql/tests/bug_42499.phpt @@ -1,12 +1,10 @@ --TEST-- Bug #42499 (Multi-statement execution via PDO::exec() makes connection unusable) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS test'); print "done!"; ?> +--CLEAN-- + --EXPECTF-- Emulated Prepared Statements... array(1) { diff --git a/ext/pdo_mysql/tests/bug_43371.phpt b/ext/pdo_mysql/tests/bug_43371.phpt index f8b98c237a2c4..87fd45b43a221 100644 --- a/ext/pdo_mysql/tests/bug_43371.phpt +++ b/ext/pdo_mysql/tests/bug_43371.phpt @@ -4,12 +4,12 @@ Bug #43371 (Memory errors in PDO constructor) pdo_mysql --SKIPIF-- --FILE-- true)); diff --git a/ext/pdo_mysql/tests/bug_44454.phpt b/ext/pdo_mysql/tests/bug_44454.phpt index 26381637f13af..14cc2844b0cf3 100644 --- a/ext/pdo_mysql/tests/bug_44454.phpt +++ b/ext/pdo_mysql/tests/bug_44454.phpt @@ -1,19 +1,16 @@ --TEST-- Bug #44454 (Unexpected exception thrown in foreach() statement) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Native Prepared Statements diff --git a/ext/pdo_mysql/tests/bug_44707.phpt b/ext/pdo_mysql/tests/bug_44707.phpt index 21a273af4eefd..dca1e84fc95f2 100644 --- a/ext/pdo_mysql/tests/bug_44707.phpt +++ b/ext/pdo_mysql/tests/bug_44707.phpt @@ -1,12 +1,10 @@ --TEST-- Bug #44707 (The MySQL PDO driver resets variable content after bindParam on tinyint field) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- +--CLEAN-- + --EXPECT-- Native Prepared Statements bool(false) diff --git a/ext/pdo_mysql/tests/bug_45120.phpt b/ext/pdo_mysql/tests/bug_45120.phpt index 01654e4a3f86a..7be3db7e6510e 100644 --- a/ext/pdo_mysql/tests/bug_45120.phpt +++ b/ext/pdo_mysql/tests/bug_45120.phpt @@ -1,19 +1,16 @@ --TEST-- Bug #45120 (PDOStatement->execute() returns true then false for same statement) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- --FILE-- --CLEAN-- exec('DROP DATABASE IF EXISTS `crazy;dbname`'); ?> diff --git a/ext/pdo_mysql/tests/bug_51670.phpt b/ext/pdo_mysql/tests/bug_51670.phpt index f3fc7277deeb0..dbdce15f469ba 100644 --- a/ext/pdo_mysql/tests/bug_51670.phpt +++ b/ext/pdo_mysql/tests/bug_51670.phpt @@ -1,18 +1,16 @@ --TEST-- Bug #51670 (getColumnMeta causes segfault when re-executing query after calling nextRowset) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- prepare('SELECT 1 AS num'); $query->execute(); if(!is_array($query->getColumnMeta(0))) die('FAIL!'); diff --git a/ext/pdo_mysql/tests/bug_61207.phpt b/ext/pdo_mysql/tests/bug_61207.phpt index 0263b32394463..ae7cc48bd8594 100644 --- a/ext/pdo_mysql/tests/bug_61207.phpt +++ b/ext/pdo_mysql/tests/bug_61207.phpt @@ -4,13 +4,12 @@ PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't al pdo_mysql --SKIPIF-- --FILE-- query("DROP TABLE test"); ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/bug_61411.phpt b/ext/pdo_mysql/tests/bug_61411.phpt index 4993820c1a609..2c0a06742da49 100644 --- a/ext/pdo_mysql/tests/bug_61411.phpt +++ b/ext/pdo_mysql/tests/bug_61411.phpt @@ -1,14 +1,13 @@ --TEST-- Bug #61411 (PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) @@ -21,7 +20,7 @@ if ($version < 40106) ?> --FILE-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo_mysql/tests/bug_74376.phpt b/ext/pdo_mysql/tests/bug_74376.phpt index 80abdc1251416..01b1982bae9ae 100644 --- a/ext/pdo_mysql/tests/bug_74376.phpt +++ b/ext/pdo_mysql/tests/bug_74376.phpt @@ -1,16 +1,15 @@ --TEST-- Bug #74376 (Invalid free of persistent results on error/connection loss) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- --FILE-- exec('DROP TABLE IF EXISTS test'); print "done!"; ?> +--CLEAN-- + --EXPECT-- Emulated... array(1) { diff --git a/ext/pdo_mysql/tests/bug_pecl_7976.phpt b/ext/pdo_mysql/tests/bug_pecl_7976.phpt index 62dfaec947770..dbc0893d16ffb 100644 --- a/ext/pdo_mysql/tests/bug_pecl_7976.phpt +++ b/ext/pdo_mysql/tests/bug_pecl_7976.phpt @@ -1,14 +1,13 @@ --TEST-- PECL Bug #7976 (Calling stored procedure several times) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) @@ -21,7 +20,7 @@ if ($version < 50000) ?> --FILE-- --CLEAN-- exec('DROP PROCEDURE IF EXISTS p'); ?> diff --git a/ext/pdo_mysql/tests/change_column_count.phpt b/ext/pdo_mysql/tests/change_column_count.phpt index 9ec62b2f1e864..0db9b2e05b52f 100644 --- a/ext/pdo_mysql/tests/change_column_count.phpt +++ b/ext/pdo_mysql/tests/change_column_count.phpt @@ -1,16 +1,15 @@ --TEST-- Change column count after statement has been prepared --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -36,7 +35,7 @@ var_dump($stmt->fetchAll(\PDO::FETCH_ASSOC)); ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt deleted file mode 100644 index a5f6af203e8f1..0000000000000 --- a/ext/pdo_mysql/tests/common.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -MySQL ---EXTENSIONS-- -pdo -pdo_mysql ---REDIRECTTEST-- -# magic auto-configuration - -$config = array( - 'TESTS' => __DIR__.'/ext/pdo/tests' -); - -if (false !== getenv('PDO_MYSQL_TEST_DSN')) { - # user set them from their shell - $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN'); - $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER'); - $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS'); - if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { - $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); - } -} else { - $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; - $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = ''; -} - -return $config; diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc deleted file mode 100644 index 8bcc1ee65968f..0000000000000 --- a/ext/pdo_mysql/tests/config.inc +++ /dev/null @@ -1,52 +0,0 @@ - $v) { - putenv("$k=$v"); -} - -/* MySQL specific settings */ -define('PDO_MYSQL_TEST_ENGINE', (false !== getenv('PDO_MYSQL_TEST_ENGINE')) ? getenv('PDO_MYSQL_TEST_ENGINE') : 'InnoDB'); -define('PDO_MYSQL_TEST_HOST', (false !== getenv('PDO_MYSQL_TEST_HOST')) ? getenv('PDO_MYSQL_TEST_HOST') : 'localhost'); -define('PDO_MYSQL_TEST_PORT', (false !== getenv('PDO_MYSQL_TEST_PORT')) ? getenv('PDO_MYSQL_TEST_PORT') : NULL); -define('PDO_MYSQL_TEST_DB', (false !== getenv('PDO_MYSQL_TEST_DB')) ? getenv('PDO_MYSQL_TEST_DB') : 'test'); -define('PDO_MYSQL_TEST_SOCKET', (false !== getenv('PDO_MYSQL_TEST_SOCKET')) ? getenv('PDO_MYSQL_TEST_SOCKET') : NULL); -define('PDO_MYSQL_TEST_DSN', (false !== getenv('PDO_MYSQL_TEST_DSN')) ? getenv('PDO_MYSQL_TEST_DSN') : $config['ENV']['PDOTEST_DSN']); -define('PDO_MYSQL_TEST_USER', (false !== getenv('PDO_MYSQL_TEST_USER')) ? getenv('PDO_MYSQL_TEST_USER') : $config['ENV']['PDOTEST_USER']); -define('PDO_MYSQL_TEST_PASS', (false !== getenv('PDO_MYSQL_TEST_PASS')) ? getenv('PDO_MYSQL_TEST_PASS') : $config['ENV']['PDOTEST_PASS']); -define('PDO_MYSQL_TEST_CHARSET', (false !== getenv('PDO_MYSQL_TEST_CHARSET')) ? getenv('PDO_MYSQL_TEST_CHARSET') : NULL); - -if (!function_exists('sys_get_temp_dir')) { - function sys_get_temp_dir() { - - if (!empty($_ENV['TMP'])) - return realpath( $_ENV['TMP'] ); - if (!empty($_ENV['TMPDIR'])) - return realpath( $_ENV['TMPDIR'] ); - if (!empty($_ENV['TEMP'])) - return realpath( $_ENV['TEMP'] ); - - $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); - if ($temp_file) { - $temp_dir = realpath(dirname($temp_file)); - unlink($temp_file); - return $temp_dir; - } - return FALSE; - } -} -?> diff --git a/ext/pdo_mysql/tests/gh11550.phpt b/ext/pdo_mysql/tests/gh11550.phpt index 5bf0b26497ca0..977e03bb2b179 100644 --- a/ext/pdo_mysql/tests/gh11550.phpt +++ b/ext/pdo_mysql/tests/gh11550.phpt @@ -1,16 +1,15 @@ --TEST-- Bug GH-11550 (MySQL Statement has a empty query result when the response field has changed, also Segmentation fault) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec(<<<'SQL' @@ -40,7 +39,7 @@ echo 'Done'; ?> --CLEAN-- query('DROP TABLE IF EXISTS test_gh11550'); ?> diff --git a/ext/pdo_mysql/tests/gh-11587.phpt b/ext/pdo_mysql/tests/gh11587.phpt similarity index 90% rename from ext/pdo_mysql/tests/gh-11587.phpt rename to ext/pdo_mysql/tests/gh11587.phpt index 45aecba794ab3..dd1785374bdd3 100644 --- a/ext/pdo_mysql/tests/gh-11587.phpt +++ b/ext/pdo_mysql/tests/gh11587.phpt @@ -4,13 +4,13 @@ GH-11587 PHP8.1: Fixed the condition for result set values to be of native type, pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS test'); @@ -76,7 +76,7 @@ echo 'done!'; ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/inc/config.inc b/ext/pdo_mysql/tests/inc/config.inc new file mode 100644 index 0000000000000..d0402b8c089dc --- /dev/null +++ b/ext/pdo_mysql/tests/inc/config.inc @@ -0,0 +1,17 @@ + false !== getenv('PDO_MYSQL_TEST_DSN') ? getenv('PDO_MYSQL_TEST_DSN') : 'mysql:host=localhost;dbname=test', + 'PDO_MYSQL_TEST_USER' => false !== getenv('PDO_MYSQL_TEST_USER') ? getenv('PDO_MYSQL_TEST_USER') : 'root', + 'PDO_MYSQL_TEST_PASS' => false !== getenv('PDO_MYSQL_TEST_PASS') ? getenv('PDO_MYSQL_TEST_PASS') : '', + 'PDO_MYSQL_TEST_ENGINE' => false !== getenv('PDO_MYSQL_TEST_ENGINE') ? getenv('PDO_MYSQL_TEST_ENGINE') : 'InnoDB', + 'PDO_MYSQL_TEST_HOST' => false !== getenv('PDO_MYSQL_TEST_HOST') ? getenv('PDO_MYSQL_TEST_HOST') : 'localhost', + 'PDO_MYSQL_TEST_PORT' => false !== getenv('PDO_MYSQL_TEST_PORT') ? getenv('PDO_MYSQL_TEST_PORT') : null, + 'PDO_MYSQL_TEST_DB' => false !== getenv('PDO_MYSQL_TEST_DB') ? getenv('PDO_MYSQL_TEST_DB') : 'test', + 'PDO_MYSQL_TEST_SOCKET' => false !== getenv('PDO_MYSQL_TEST_SOCKET') ? getenv('PDO_MYSQL_TEST_SOCKET') : null, + 'PDO_MYSQL_TEST_CHARSET' => false !== getenv('PDO_MYSQL_TEST_CHARSET') ? getenv('PDO_MYSQL_TEST_CHARSET') : null, +]; + +if (false !== getenv('PDO_MYSQL_TEST_ATTR')) { + $env['PDO_MYSQL_TEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR'); +} +?> diff --git a/ext/pdo_mysql/tests/inc/init.inc b/ext/pdo_mysql/tests/inc/init.inc new file mode 100644 index 0000000000000..d75c5956b18dc --- /dev/null +++ b/ext/pdo_mysql/tests/inc/init.inc @@ -0,0 +1,45 @@ + $config['PDOTEST_DSN'], + 'PDO_MYSQL_TEST_USER' => $config['PDOTEST_USER'], + 'PDO_MYSQL_TEST_PASS' => $config['PDO_MYSQL_TEST_PASS'], +] = $env; + +if (array_key_exists('PDO_MYSQL_TEST_ATTR', $env)) { + $config['PDOTEST_ATTR'] = $env['PDO_MYSQL_TEST_ATTR']; +} + +foreach ($config as $k => $v) { + putenv("$k=$v"); +} + +/* MySQL specific settings */ +foreach ($env as $k => $v) { + define($k, $v); +} + +if (!function_exists('sys_get_temp_dir')) { + function sys_get_temp_dir() { + + if (!empty($_ENV['TMP'])) + return realpath( $_ENV['TMP'] ); + if (!empty($_ENV['TMPDIR'])) + return realpath( $_ENV['TMPDIR'] ); + if (!empty($_ENV['TEMP'])) + return realpath( $_ENV['TEMP'] ); + + $temp_file = tempnam(md5(uniqid(rand(), TRUE)), ''); + if ($temp_file) { + $temp_dir = realpath(dirname($temp_file)); + unlink($temp_file); + return $temp_dir; + } + return FALSE; + } +} +?> diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/inc/mysql_pdo_test.inc similarity index 80% rename from ext/pdo_mysql/tests/mysql_pdo_test.inc rename to ext/pdo_mysql/tests/inc/mysql_pdo_test.inc index 880f8dbf758f5..008bf4d0e324b 100644 --- a/ext/pdo_mysql/tests/mysql_pdo_test.inc +++ b/ext/pdo_mysql/tests/inc/mysql_pdo_test.inc @@ -1,6 +1,6 @@ exec('DROP TABLE IF EXISTS test'); } - } ?> diff --git a/ext/pdo_mysql/tests/skipifinfilenotallowed.inc b/ext/pdo_mysql/tests/inc/skipifinfilenotallowed.inc similarity index 100% rename from ext/pdo_mysql/tests/skipifinfilenotallowed.inc rename to ext/pdo_mysql/tests/inc/skipifinfilenotallowed.inc diff --git a/ext/pdo_mysql/tests/last_insert_id.phpt b/ext/pdo_mysql/tests/last_insert_id.phpt index 600e70af60e94..bb1747cd53f96 100644 --- a/ext/pdo_mysql/tests/last_insert_id.phpt +++ b/ext/pdo_mysql/tests/last_insert_id.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL auto_increment / last insert id --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- query("CREATE TABLE test (id int auto_increment primary key, num int)")); @@ -22,6 +20,11 @@ print_r($db->query("INSERT INTO test (num) VALUES (451)")); print_r($db->lastInsertId()); ?> +--CLEAN-- + --EXPECT-- PDOStatement Object ( diff --git a/ext/pdo_mysql/tests/native_types.phpt b/ext/pdo_mysql/tests/native_types.phpt index 0516bc3353201..1188a0f408234 100644 --- a/ext/pdo_mysql/tests/native_types.phpt +++ b/ext/pdo_mysql/tests/native_types.phpt @@ -4,13 +4,13 @@ PDO MySQL should use native types if ATTR_STRINGIFY_FETCHES is not enabled pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -27,7 +27,7 @@ var_dump($db->query('SELECT * FROM test')->fetchAll(PDO::FETCH_ASSOC)); ?> --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt index aa52764dea2c7..75c1ecf4c3a8e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt @@ -4,13 +4,13 @@ MySQL PDO->__construct() - Generic + DSN pdo_mysql --SKIPIF-- --FILE-- __construct() - URI pdo_mysql --SKIPIF-- __construct(), options pdo_mysql --SKIPIF-- --FILE-- __construct(), libmysql only options pdo_mysql --SKIPIF-- --FILE-- __construct() - URI pdo_mysql --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt index 1c629a3f01397..8a04f6ed1c60c 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt @@ -4,13 +4,12 @@ PDO::ATTR_CASE pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); MySQLPDOTest::createTestTable($db); @@ -88,7 +87,7 @@ $db = MySQLPDOTest::factory(); ?> --CLEAN-- --EXPECT-- 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 396624e04546b..fd07592870fd1 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt @@ -4,13 +4,12 @@ PDO::ATTR_CLIENT_VERSION pdo_mysql --SKIPIF-- --FILE-- errorCode()) || ('00000' == $db->errorCode())); 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 b1896e53ee722..0b22806a8cbba 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt @@ -4,13 +4,12 @@ PDO::ATTR_CONNECTION_STATUS pdo_mysql --SKIPIF-- --FILE-- getAttribute(PDO::ATTR_CONNECTION_STATUS); 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 fadf5e979f977..76035f0a7d1da 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt @@ -4,13 +4,12 @@ PDO::ATTR_DRIVER_NAME pdo_mysql --SKIPIF-- --FILE-- errorCode()) || ('00000' == $db->errorCode())); diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt index 40c985b4c3fdb..a90e78dc58643 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt @@ -4,15 +4,14 @@ PDO::ATTR_ERRMODE pdo_mysql --SKIPIF-- --INI-- error_reporting=E_ALL --FILE-- --FILE-- +--CLEAN-- + --EXPECT-- array(1) { [0]=> 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 a6921b092895a..14bbb2e924a90 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt @@ -4,15 +4,14 @@ PDO::MYSQL_ATTR_INIT_COMMAND pdo_mysql --SKIPIF-- --INI-- error_reporting=E_ALL --FILE-- __construct(), PDO::MYSQL_ATTR_MAX_BUFFER_SIZE pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- [001] id = 1, val = 0123456789... (length: %d) diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt index 9c97729ccc82c..32d3711cd7d5c 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt @@ -4,15 +4,14 @@ PDO::MYSQL_ATTR_MULTI_STATEMENTS pdo_mysql --SKIPIF-- --INI-- error_reporting=E_ALL --FILE-- --FILE-- +--CLEAN-- + --EXPECTF-- Attribute value must be of type int for selected attribute, array given Attribute value must be of type int for selected attribute, stdClass given diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt index f24de5a390a4c..fb0e955367adf 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt @@ -4,13 +4,12 @@ PDO::ATTR_PREFETCH pdo_mysql --SKIPIF-- --FILE-- getAttribute(PDO::ATTR_PREFETCH)); var_dump($db->setAttribute(PDO::ATTR_PREFETCH, true)); diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt index c672acd2eb635..b39f9c3a075ff 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt @@ -4,13 +4,12 @@ PDO::ATTR_SERVER_INFO pdo_mysql --SKIPIF-- --FILE-- errorCode()) || ('00000' == $db->errorCode())); 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 e193ae3fca5bf..03579c7e6f6dc 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt @@ -4,13 +4,12 @@ PDO::ATTR_SERVER_VERSION pdo_mysql --SKIPIF-- --FILE-- errorCode()) || ('00000' == $db->errorCode())); 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 317e3ec3a22f0..2754a617d6523 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt @@ -4,13 +4,12 @@ PDO::ATTR_STATEMENT_CLASS pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); MySQLPDOTest::createTestTable($db); @@ -123,6 +122,11 @@ $db = MySQLPDOTest::factory(); echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; } +?> +--CLEAN-- + --EXPECT-- array(1) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt index 7c78d691eaf0c..f1004cc81c4a2 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt @@ -4,15 +4,12 @@ PDO->beginTransaction() pdo_mysql --SKIPIF-- +MySQLPDOTest::skipNotTransactionalEngine(); --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt index 38d0bb85646ed..5e5d7aa278bf0 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt @@ -4,7 +4,7 @@ MySQL PDO->exec(), BIT columns - remove after fix! pdo_mysql --SKIPIF-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- array(2) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt index a79e219fd076a..d79712ec6c190 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt @@ -6,13 +6,13 @@ pdo_mysql --FILE-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt index 58d1956edde78..6a954fa5486eb 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt @@ -4,15 +4,12 @@ MySQL PDO->commit() pdo_mysql --SKIPIF-- +MySQLPDOTest::skipNotTransactionalEngine(); --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test_commit'); MySQLPDOTest::dropTestTable($db); diff --git a/ext/pdo_mysql/tests/pdo_mysql_connect_attr.phpt b/ext/pdo_mysql/tests/pdo_mysql_connect_attr.phpt index 810f96012665c..a35c8cff9f8ca 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_connect_attr.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_connect_attr.phpt @@ -4,9 +4,9 @@ PDO_MYSQL: check the session_connect_attrs table for connection attributes pdo_mysql --SKIPIF-- fetchColumn(1) !== 'ON') { --FILE-- --EXPECT-- -done! \ No newline at end of file +done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt index 1c57b0a4593b3..6b47214136a90 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt @@ -4,12 +4,12 @@ PDO_MYSQL: Defining a connection charset in the DSN pdo_mysql --SKIPIF-- --FILE-- errorCode() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt index ef24fb1135f75..5528e19d9e8a6 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt @@ -4,13 +4,12 @@ MySQL PDO->errorInfo() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt index 8f5d9728df7d4..92f46ab43ea4e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt @@ -4,7 +4,7 @@ MySQL PDO->exec(), affected rows pdo_mysql --SKIPIF-- --FILE-- @@ -30,7 +30,7 @@ MySQLPDOTest::skip(); return true; } - require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); @@ -175,10 +175,8 @@ MySQLPDOTest::skip(); ?> --CLEAN-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); -@$db->exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --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 %s server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on 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 834706a2bad03..c7fb5c38640c4 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt @@ -4,7 +4,7 @@ MySQL PDO->exec(), affected rows pdo_mysql --SKIPIF-- --FILE-- @@ -34,7 +34,7 @@ MySQLPDOTest::skip(); return true; } - require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); @@ -81,7 +81,7 @@ MySQLPDOTest::skip(); ?> --CLEAN-- exec(), affected rows pdo_mysql --SKIPIF-- fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { return true; } - require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); putenv('PDOTEST_ATTR='.serialize([PDO::MYSQL_ATTR_LOCAL_INFILE=>true])); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); @@ -106,9 +106,8 @@ if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt index da66cf3293ef4..3d3d250cb0c7b 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt @@ -4,7 +4,7 @@ MySQL PDO->exec(), SELECT pdo_mysql --SKIPIF-- --FILE-- @@ -30,7 +30,7 @@ MySQLPDOTest::skip(); return true; } - require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); @@ -56,9 +56,8 @@ MySQLPDOTest::skip(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --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 diff --git a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt index a01c49bc41e89..edd947ed9a936 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->fetch() pdo_mysql --SKIPIF-- --FILE-- getAttribute() pdo_mysql --SKIPIF-- +MySQLPDOTest::skipNotTransactionalEngine(); --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt index d6fe59a6c1b63..addc07d024705 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt @@ -4,12 +4,12 @@ MySQL PDO class inTransaction pdo_mysql --SKIPIF-- --FILE-- +MySQLPDOTest::skipNotTransactionalEngine(); --FILE-- lastInsertId() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_local_infile_default_off.phpt b/ext/pdo_mysql/tests/pdo_mysql_local_infile_default_off.phpt index 24e2954b77265..7777da353b7a5 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_local_infile_default_off.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_local_infile_default_off.phpt @@ -4,7 +4,7 @@ ensure default for local infile is off pdo_mysql --SKIPIF-- --FILE-- --FILE-- false, PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY=>__DIR__."/foo" @@ -78,9 +75,8 @@ if (!defined('PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY')) { ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_local_infile_directory_denied.phpt b/ext/pdo_mysql/tests/pdo_mysql_local_infile_directory_denied.phpt index 62e8799639454..6131b095e4cc9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_local_infile_directory_denied.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_local_infile_directory_denied.phpt @@ -4,12 +4,9 @@ PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY vs access denied pdo_mysql --SKIPIF-- --FILE-- false, PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY=>__DIR__."/foo/bar" @@ -68,9 +65,8 @@ if (!defined('PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY')) { ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Warning: PDO::exec(): SQLSTATE[HY000]: General error: 2068 LOAD DATA LOCAL INFILE %s in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_local_infile_overrides_local_infile_directory.phpt b/ext/pdo_mysql/tests/pdo_mysql_local_infile_overrides_local_infile_directory.phpt index 9b26719fa08e1..1e7f1cd9ebfda 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_local_infile_overrides_local_infile_directory.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_local_infile_overrides_local_infile_directory.phpt @@ -4,12 +4,9 @@ PDO::MYSQL_ATTR_LOCAL_INFILE overrides PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY pdo_mysql --SKIPIF-- --FILE-- true, PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY=>__DIR__."/foo/bar" @@ -78,9 +75,8 @@ if (!defined('PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY')) { ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt b/ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt index bd79cc5e6828c..166a8bfc336df 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt @@ -4,13 +4,12 @@ enable local infile pdo_mysql --SKIPIF-- --FILE-- nextRowSet() with PDO::MYSQL_ATTR_MULTI_STATEMENTS either tr pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); @@ -19,7 +19,7 @@ if ($version < 50000) ?> --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -83,7 +83,7 @@ if ($version < 50000) ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt b/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt index c37688827029a..c64ca75b76354 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt @@ -1,19 +1,16 @@ --TEST-- PDO MySQL national character set parameters don't affect true prepared statements --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_EMULATE_PREPARES, 0); @@ -31,7 +28,7 @@ foreach ($db->query('SELECT * from test') as $row) { ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt index 8c397bd7c762a..f3b0c1372d84d 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt @@ -4,12 +4,12 @@ MySQL PDO->__construct(), PDO::ATTR_PERSISTENT pdo_mysql --SKIPIF-- --FILE-- --FILE-- prepare(), emulated PS pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -324,9 +323,8 @@ $db = MySQLPDOTest::factory(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- PDO::prepare(): Argument #1 ($query) cannot be empty 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 59a1c4e31f739..47b80c93ce781 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt @@ -4,13 +4,12 @@ MySQL PDO->prepare(), emulated PS, anonymous placeholder pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in %s on line %d 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 b7528f68d81fa..b9a65e2ff3410 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 @@ -4,13 +4,13 @@ MySQL PDO->prepare(), emulated PS, anonymous placeholder pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d 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 0fd19a7e8cc10..105db89a4c52b 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt @@ -4,12 +4,12 @@ Bug #41876 (bindParam() and bindValue() do not work with MySQL MATCH () AGAINST pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- 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 46896a77994bd..546f34f37b335 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- PDO::prepare(): Argument #1 ($query) cannot be empty 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 8dfafbb37f977..b5e599f2cb6b9 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 @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS, clear line after error pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -72,9 +71,8 @@ $db = MySQLPDOTest::factory(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Warning: PDOStatement::execute(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d 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 f94d8f83abb33..f088b39257109 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS, named placeholder pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- array(1) { 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 1891333aa2fc1..8d200e088122f 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 @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS, named placeholder II pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -98,9 +97,8 @@ $db = MySQLPDOTest::factory(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Native... 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 d1e4cc8d30134..23a87bbb69896 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 @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS, mixed, wired style pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- 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 821d19cd658e8..09b61c0a4fc8f 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 @@ -4,13 +4,12 @@ MySQL PDO->prepare(), native PS, named placeholder pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d 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 a428fb11998f4..62d5ca92ae45c 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 @@ -4,13 +4,12 @@ MySQL PDO->prepare(),native PS, anonymous placeholder pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -55,9 +54,8 @@ $db = MySQLPDOTest::factory(); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- array(1) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_quote.phpt b/ext/pdo_mysql/tests/pdo_mysql_quote.phpt index 3c3cde297f1a9..c51ed6f352863 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_quote.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_quote.phpt @@ -4,12 +4,12 @@ MySQL ensure quote function returns expected results pdo_mysql --SKIPIF-- --FILE-- quote('foo', PDO::PARAM_STR)); diff --git a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt index 81d4f143923fa..6d910adaf26ff 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt @@ -4,15 +4,12 @@ PDO::rollBack() pdo_mysql --SKIPIF-- +MySQLPDOTest::skipNotTransactionalEngine(); --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +MySQLPDOTest::dropTestTable($db); $db->exec('DROP TABLE IF EXISTS test2'); ?> --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt index 218a6d702a43a..bdea9083606f9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->bindColumn() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- id = 1 (integer) / label = 'a' (string) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt index f20181010b969..84ce15bbd9ae7 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt @@ -4,12 +4,12 @@ MySQL PDOStatement->bindParam() pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); @@ -119,7 +119,7 @@ MySQLPDOTest::skip(); ?> --CLEAN-- --EXPECT-- 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 b5aa91136efe1..209861397e8f5 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->bindParam() - SQL column types pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt index 1bcc8e0e16575..ddecdc9c3d541 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->bindValue() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt index 12839b17f83af..45259e6b95d78 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt @@ -4,7 +4,7 @@ MySQL PDOStatement - inserting BLOB from stream pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); @unlink(MySQLPDOTest::getTempDir() . DIRECTORY_SEPARATOR . 'pdoblob.tst'); ?> --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt index aee5be6111969..b3968316f5b15 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt @@ -4,12 +4,12 @@ MySQL Prepared Statements and BLOBs pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt index 45725853d3c40..86877fd5b1acb 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt @@ -4,14 +4,13 @@ MySQL PDOStatement->closeCursor() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Testing emulated PS... 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 bbdb61e3d569c..cf806a7670295 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->closeCursor() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt index 3607744d87a80..133c41f5017f9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->columnCount() pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt index c3c4c68a70dd7..ae4c5d137c497 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->errorCode(); pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS ihopeitdoesnotexist'); diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt index 05770f198d2ee..9850e115e4eaf 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt @@ -4,13 +4,12 @@ MySQL PDOStatement->errorInfo(); pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- 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 b6e65f0c39701..2c9bd74c585c8 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 @@ -4,12 +4,12 @@ MySQL PDOStatement->execute()/fetch(), Non-SELECT pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- 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 5b65c8d54441f..7e0b27c31e485 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt @@ -4,12 +4,12 @@ MySQL PDOStatement->fetch(), PDO::FETCH_SERIALIZE pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d 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 b70e81f3da335..7541bd95ad50a 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 @@ -4,12 +4,12 @@ MySQL PDOStatement->fetch(), PDO::FETCH_SERIALIZE pdo_mysql --SKIPIF-- --FILE-- exec('DROP TABLE IF EXISTS test'); print "done!\n"; ?> +--CLEAN-- + --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Lets see what the Serializeable interface makes our object behave like... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt index 9f1bbd2d0f6c6..1e9fa804e4e4d 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt @@ -4,10 +4,10 @@ MySQL PDO: PDOStatement->fetchObject() pdo_mysql --SKIPIF-- prepare($query); @@ -20,7 +20,7 @@ if (!$ok) ?> --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); MySQLPDOTest::createTestTable($db); @@ -85,7 +85,7 @@ print "done!"; ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject_ctor_args.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject_ctor_args.phpt index 747d23700268e..beaf933a57a8a 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject_ctor_args.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject_ctor_args.phpt @@ -4,10 +4,10 @@ MySQL PDO: PDOStatement->fetchObject() with $constructorArgs pdo_mysql --SKIPIF-- prepare($query); @@ -20,7 +20,7 @@ if (!$ok) ?> --FILE-- --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt index d4a7b2fa98d68..3a2f5dc493140 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt @@ -4,7 +4,7 @@ MySQL: PDOStatement->getColumnMeta() pdo_mysql --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); MySQLPDOTest::createTestTable($db); @@ -301,6 +301,11 @@ try { $db->exec('DROP TABLE IF EXISTS test'); print "done!"; ?> +--CLEAN-- + --EXPECT-- PDOStatement::getColumnMeta(): Argument #1 ($column) must be greater than or equal to 0 Testing native PS... diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt index b2cbe43561b04..1ed08b39e15ae 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt @@ -4,12 +4,12 @@ PDOStatements and multi query pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt index 6114cc3d9aadd..f1ec5c24353f9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt @@ -4,7 +4,7 @@ MySQL PDOStatement->nextRowSet() pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); @@ -22,7 +22,7 @@ if (!MySQLPDOTest::isPDOMySQLnd()) ?> --FILE-- setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -110,7 +110,7 @@ if (!MySQLPDOTest::isPDOMySQLnd()) ?> --CLEAN-- --EXPECTF-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt index 4d411406cde8a..ebd2916c8b063 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt @@ -4,12 +4,12 @@ MySQL PDOStatement->rowCount() @ SELECT pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- 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 a2ddc43d726e0..f55adafcab909 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt @@ -4,15 +4,14 @@ MySQL PDO:query() vs. PDO::prepare() and MySQL error 2050 pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- 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 2b67e5ba2e406..d94bc285255cd 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt @@ -4,10 +4,10 @@ MySQL Prepared Statements and different column counts pdo_mysql --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) @@ -20,7 +20,7 @@ if ($version < 50000) ?> --FILE-- --CLEAN-- query('DROP PROCEDURE IF EXISTS p'); ?> diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt index 8ac1220e9e250..9a5c68d7e6f33 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt @@ -4,12 +4,12 @@ MySQL PDOStatement->execute()/fetch(), Non-SELECT pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECTF-- __construct('%S', '%S', %s) diff --git a/ext/pdo_mysql/tests/pdo_mysql_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_types.phpt index 01122a735ed33..80680a4df10f8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_types.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_types.phpt @@ -4,12 +4,12 @@ MySQL PDO->exec(), native types wo ZEROFILL pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt index 7f330a4292c89..a27c202b83540 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt @@ -4,12 +4,12 @@ MySQL PDO->exec(), native types - ZEROFILL pdo_mysql --SKIPIF-- --FILE-- --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- done! diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt index 7c91bc2f10ea4..e706548705dfa 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL PECL Bug #5200 (Describe table gives unexpected result mysql and type enum) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I', 'II', 'IIa', 'IIb', 'III', 'IV'))"); @@ -22,9 +20,8 @@ foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- Array diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt index 6a69c5067ade3..517eca5cfd871 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL PECL Bug #5780 (Failure to produce an error when one is expected) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec("CREATE TABLE test (login varchar(32) NOT NULL, data varchar(64) NOT NULL)"); $db->exec("CREATE TABLE test2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)"); @@ -30,9 +28,9 @@ var_dump($info); ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +MySQLPDOTest::dropTestTable($db); $db->exec('DROP TABLE IF EXISTS test2'); ?> --EXPECT-- diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt index db409ee82db05..59899cb1e0859 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL PECL Bug #5802 (bindParam/bindValue retain the is_null flag) --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- exec('create table test ( bar char(3) NULL )'); $stmt = $db->prepare('insert into test (bar) values(:bar)') or var_dump($db->errorInfo()); @@ -38,9 +36,8 @@ print "done!"; ?> --CLEAN-- exec('DROP TABLE IF EXISTS test'); +require_once(__DIR__ . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::dropTestTable(); ?> --EXPECT-- array(3) { diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt index ce2489647683e..71d5eb9893b3f 100644 --- a/ext/pdo_mysql/tests/show_tables.phpt +++ b/ext/pdo_mysql/tests/show_tables.phpt @@ -1,18 +1,16 @@ --TEST-- PDO MySQL SHOW TABLES --EXTENSIONS-- -pdo pdo_mysql --SKIPIF-- --FILE-- query('SHOW TABLES')); ?> diff --git a/ext/pdo_mysql/tests/table.inc b/ext/pdo_mysql/tests/table.inc deleted file mode 100644 index 9ef8fac134ca5..0000000000000 --- a/ext/pdo_mysql/tests/table.inc +++ /dev/null @@ -1,9 +0,0 @@ -exec('DROP TABLE IF EXISTS test'); -$db->exec('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine); -$db->exec('INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")'); -?> diff --git a/ext/pdo_mysql/tests/unsigned_bigint.phpt b/ext/pdo_mysql/tests/unsigned_bigint.phpt index e2fc9604f24ae..8fa528d79805d 100644 --- a/ext/pdo_mysql/tests/unsigned_bigint.phpt +++ b/ext/pdo_mysql/tests/unsigned_bigint.phpt @@ -1,18 +1,16 @@ --TEST-- Bug GH-7837 (large bigints may be truncated) --EXTENSIONS-- -pdo pdo_mysql -mysqlnd --SKIPIF-- --FILE-- --CLEAN-- --EXPECT--