summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r--[-rwxr-xr-x]ext/pdo_mysql/CREDITS0
-rw-r--r--[-rwxr-xr-x]ext/pdo_mysql/config.m466
-rwxr-xr-x[-rw-r--r--]ext/pdo_mysql/get_error_codes.php39
-rw-r--r--ext/pdo_mysql/mysql_driver.c31
-rw-r--r--ext/pdo_mysql/mysql_statement.c11
-rw-r--r--ext/pdo_mysql/pdo_mysql.c12
-rw-r--r--ext/pdo_mysql/php_pdo_mysql.h12
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h2
-rw-r--r--ext/pdo_mysql/tests/CONFLICTS1
-rw-r--r--ext/pdo_mysql/tests/README16
-rw-r--r--ext/pdo_mysql/tests/README.md33
-rw-r--r--ext/pdo_mysql/tests/bug41125.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug44327.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug46292.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug53551.phpt4
-rw-r--r--ext/pdo_mysql/tests/bug53782.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug54929.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug63176.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug66141.phpt4
-rw-r--r--ext/pdo_mysql/tests/bug68371.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug70272.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug70389.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug70862.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug71569.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug75177.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug77289.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug_37445.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_39483.phptbin754 -> 714 bytes
-rw-r--r--ext/pdo_mysql/tests/bug_39858.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug_41125.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug_41698.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_41997.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_42499.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_43371.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug_44454.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug_44707.phpt14
-rw-r--r--ext/pdo_mysql/tests/bug_45120.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_50323.phpt12
-rw-r--r--ext/pdo_mysql/tests/bug_51670.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_61207.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_61411.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_61755.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_74376.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug_pecl_12925.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug_pecl_7976.phpt12
-rw-r--r--ext/pdo_mysql/tests/common.phpt2
-rw-r--r--ext/pdo_mysql/tests/last_insert_id.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt13
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_bit.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_commit.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt15
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_interface.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_local_infile_default_off.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt12
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt12
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_quote.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_rollback.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt12
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_subclass.phpt16
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_types.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt8
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5200.phpt10
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5780.phpt12
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5802.phpt12
-rw-r--r--ext/pdo_mysql/tests/show_tables.phpt8
131 files changed, 573 insertions, 618 deletions
diff --git a/ext/pdo_mysql/CREDITS b/ext/pdo_mysql/CREDITS
index eb11169bd9..eb11169bd9 100755..100644
--- a/ext/pdo_mysql/CREDITS
+++ b/ext/pdo_mysql/CREDITS
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index 3e37a6adec..6f0302feab 100755..100644
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -1,19 +1,21 @@
-dnl config.m4 for extension pdo_mysql
-dnl vim: se ts=2 sw=2 et:
-
-PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO,
-[ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory
- If no value or mysqlnd is passed as DIR, the
- MySQL native driver will be used])
+PHP_ARG_WITH([pdo-mysql],
+ [for MySQL support for PDO],
+ [AS_HELP_STRING([[--with-pdo-mysql[=DIR]]],
+ [PDO: MySQL support. DIR is the MySQL base directory. If no value or mysqlnd
+ is passed as DIR, the MySQL native driver will be used])])
if test -z "$PHP_ZLIB_DIR"; then
- PHP_ARG_WITH(zlib-dir, for the location of libz,
- [ --with-zlib-dir[=DIR] PDO_MySQL: Set the path to libz install prefix], no, no)
+ PHP_ARG_WITH([zlib-dir],
+ [for the location of libz],
+ [AS_HELP_STRING([[--with-zlib-dir[=DIR]]],
+ [PDO_MySQL: Set the path to libz install prefix])],
+ [no],
+ [no])
fi
if test "$PHP_PDO_MYSQL" != "no"; then
- dnl This depends on ext/mysqli/config.m4 providing the
- dnl PHP_MYSQL_SOCKET_SEARCH macro and --with-mysql-sock configure option.
+ dnl This depends on ext/mysqli/config.m4 providing the PHP_MYSQL_SOCKET_SEARCH
+ dnl macro and --with-mysql-sock configure option.
AC_MSG_CHECKING([for MySQL UNIX socket location])
if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
MYSQL_SOCK=$PHP_MYSQL_SOCK
@@ -29,16 +31,6 @@ if test "$PHP_PDO_MYSQL" != "no"; then
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
fi
- AC_DEFUN([PDO_MYSQL_LIB_CHK], [
- str="$PDO_MYSQL_DIR/$1/libmysqlclient*"
- for j in `echo $str`; do
- if test -r $j; then
- PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/$1
- break 2
- fi
- done
- ])
-
if test "$PHP_PDO_MYSQL" != "yes" && test "$PHP_PDO_MYSQL" != "mysqlnd"; then
if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then
PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL
@@ -132,37 +124,21 @@ if test "$PHP_PDO_MYSQL" != "no"; then
])
fi
- ifdef([PHP_CHECK_PDO_INCLUDES],
- [
- PHP_CHECK_PDO_INCLUDES
- ],[
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_cv_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_cv_inc_path=$abs_srcdir/ext
- elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
- pdo_cv_inc_path=$phpincludedir/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_cv_inc_path)
- ])
+ PHP_CHECK_PDO_INCLUDES
if test -n "$PDO_MYSQL_CONFIG"; then
PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
fi
- dnl fix after renaming to pdo_mysql
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
- ifdef([PHP_ADD_EXTENSION_DEP],
- [
- PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
- if test "$PHP_MYSQL" = "mysqlnd"; then
- PHP_ADD_EXTENSION_DEP(pdo_mysql, mysqlnd)
- fi
- ])
+
+ PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
+
+ if test "$PHP_PDO_MYSQL" = "yes" || test "$PHP_PDO_MYSQL" = "mysqlnd"; then
+ PHP_ADD_EXTENSION_DEP(pdo_mysql, mysqlnd)
+ fi
+
PDO_MYSQL_MODULE_TYPE=external
PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)
diff --git a/ext/pdo_mysql/get_error_codes.php b/ext/pdo_mysql/get_error_codes.php
index 4605df564a..27910f8dad 100644..100755
--- a/ext/pdo_mysql/get_error_codes.php
+++ b/ext/pdo_mysql/get_error_codes.php
@@ -1,27 +1,28 @@
+#!/usr/bin/env php
<?php
- $codes = array();
- $maxlen = 0;
+ $codes = array();
+ $maxlen = 0;
- while (!feof(STDIN)) {
- $line = fgets(STDIN);
+ while (!feof(STDIN)) {
+ $line = fgets(STDIN);
- if (ereg('^\{[[:space:]]+(ER_.*)[[:space:]]+,[[:space:]]*"(.*)",[[:space:]]*"(.*)"', $line, $matches)) {
- $codes[$matches[1]] = $matches[2];
- $maxlen = max($maxlen, strlen($matches[1]));
- }
- }
+ if (ereg('^\{[[:space:]]+(ER_.*)[[:space:]]+,[[:space:]]*"(.*)",[[:space:]]*"(.*)"', $line, $matches)) {
+ $codes[$matches[1]] = $matches[2];
+ $maxlen = max($maxlen, strlen($matches[1]));
+ }
+ }
- if (empty($codes)) {
- fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
- exit(3);
- }
+ if (empty($codes)) {
+ fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
+ exit(3);
+ }
- echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
- foreach ($codes as $code => $state) {
- echo "#ifdef $code\n";
- printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
- echo "#endif\n";
- }
+ echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
+ foreach ($codes as $code => $state) {
+ echo "#ifdef $code\n";
+ printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
+ echo "#endif\n";
+ }
?>
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 0d8c77d351..42f148505d 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -387,7 +387,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
PDO_DBG_RETURN(1);
case PDO_ATTR_DEFAULT_STR_PARAM:
- ((pdo_mysql_db_handle *)dbh->driver_data)->assume_national_character_set_strings = lval == PDO_PARAM_STR_NATL ? 1 : 0;
+ ((pdo_mysql_db_handle *)dbh->driver_data)->assume_national_character_set_strings = lval == PDO_PARAM_STR_NATL;
PDO_DBG_RETURN(1);
case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
@@ -567,9 +567,11 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
struct pdo_data_src_parser vars[] = {
{ "charset", NULL, 0 },
{ "dbname", "", 0 },
- { "host", "localhost", 0 },
- { "port", "3306", 0 },
+ { "host", "localhost", 0 },
+ { "port", "3306", 0 },
{ "unix_socket", PDO_DEFAULT_MYSQL_UNIX_ADDR, 0 },
+ { "user", NULL, 0 },
+ { "password", NULL, 0 },
};
int connect_opts = 0
#ifdef CLIENT_MULTI_RESULTS
@@ -595,7 +597,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
PDO_DBG_INF("multi results");
#endif
- php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5);
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 7);
H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent);
@@ -649,7 +651,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare);
H->assume_national_character_set_strings = pdo_attr_lval(driver_options,
- PDO_ATTR_DEFAULT_STR_PARAM, 0) == PDO_PARAM_STR_NATL ? 1 : 0;
+ PDO_ATTR_DEFAULT_STR_PARAM, 0) == PDO_PARAM_STR_NATL;
#ifndef PDO_USE_MYSQLND
H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size);
@@ -814,6 +816,14 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
unix_socket = vars[4].optval;
}
+ if (!dbh->username && vars[5].optval) {
+ dbh->username = pestrdup(vars[5].optval, dbh->is_persistent);
+ }
+
+ if (!dbh->password && vars[6].optval) {
+ dbh->password = pestrdup(vars[6].optval, dbh->is_persistent);
+ }
+
/* TODO: - Check zval cache + ZTS */
#ifdef PDO_USE_MYSQLND
if (dbname) {
@@ -862,12 +872,3 @@ const pdo_driver_t pdo_mysql_driver = {
PDO_DRIVER_HEADER(mysql),
pdo_mysql_handle_factory
};
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 4e23d10245..9b880ea1fa 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -938,12 +938,3 @@ const struct pdo_stmt_methods mysql_stmt_methods = {
pdo_mysql_stmt_next_rowset,
pdo_mysql_stmt_cursor_closer
};
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 60813a62dc..54e1c931ce 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -263,13 +263,3 @@ zend_module_entry pdo_mysql_module_entry = {
STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
index c48ca4516d..fa34e70f3a 100644
--- a/ext/pdo_mysql/php_pdo_mysql.h
+++ b/ext/pdo_mysql/php_pdo_mysql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -37,13 +37,3 @@ extern zend_module_entry pdo_mysql_module_entry;
#endif /* PHP_PDO_MYSQL_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index 486780acdc..edded8dea9 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/pdo_mysql/tests/CONFLICTS b/ext/pdo_mysql/tests/CONFLICTS
new file mode 100644
index 0000000000..0eaebf1275
--- /dev/null
+++ b/ext/pdo_mysql/tests/CONFLICTS
@@ -0,0 +1 @@
+mysql
diff --git a/ext/pdo_mysql/tests/README b/ext/pdo_mysql/tests/README
deleted file mode 100644
index 920f5ef474..0000000000
--- a/ext/pdo_mysql/tests/README
+++ /dev/null
@@ -1,16 +0,0 @@
-You must set the following environment variables to run the tests:
-
- PDO_MYSQL_TEST_DSN - DSN
- For example: mysql:dbname=test;host=localhost;port=3306
-
- PDO_MYSQL_TEST_HOST - database host
- PDO_MYSQL_TEST_DB - database (schema) name
- PDO_MYSQL_TEST_SOCKET - database server socket
- PDO_MYSQL_TEST_ENGINE - storage engine to use
- PDO_MYSQL_TEST_USER - database user
- PDO_MYSQL_TEST_PASS - database user password
- PDO_MYSQL_TEST_CHARSET - database charset
-
- NOTE: if any of PDO_MYSQL_TEST_[HOST|DB|SOCKET|ENGINE|CHARSET] is
- part of PDO_MYSQL_TEST_DSN, the values must match. That is, for example,
- for PDO_MYSQL_TEST_DSN = mysql:dbname=test you MUST set PDO_MYSQL_TEST_DB=test.
diff --git a/ext/pdo_mysql/tests/README.md b/ext/pdo_mysql/tests/README.md
new file mode 100644
index 0000000000..afdac4189a
--- /dev/null
+++ b/ext/pdo_mysql/tests/README.md
@@ -0,0 +1,33 @@
+# The pdo_mysql extension tests
+
+You must set the following environment variables to run the tests:
+
+```bash
+# DSN; For example: mysql:dbname=test;host=localhost;port=3306
+PDO_MYSQL_TEST_DSN
+
+# Database host
+PDO_MYSQL_TEST_HOST
+
+# Database (schema) name
+PDO_MYSQL_TEST_DB
+
+# Database server socket
+PDO_MYSQL_TEST_SOCKET
+
+# Storage engine to use
+PDO_MYSQL_TEST_ENGINE
+
+# Database user
+PDO_MYSQL_TEST_USER
+
+# Database user password
+PDO_MYSQL_TEST_PASS
+
+# Database charset
+PDO_MYSQL_TEST_CHARSET
+```
+
+NOTE: if any of `PDO_MYSQL_TEST_[HOST|DB|SOCKET|ENGINE|CHARSET]` is part of
+`PDO_MYSQL_TEST_DSN`, the values must match. That is, for example, for
+`PDO_MYSQL_TEST_DSN = mysql:dbname=test` you MUST set `PDO_MYSQL_TEST_DB=test`.
diff --git a/ext/pdo_mysql/tests/bug41125.phpt b/ext/pdo_mysql/tests/bug41125.phpt
index 66ecbc7d4d..2212bb621d 100644
--- a/ext/pdo_mysql/tests/bug41125.phpt
+++ b/ext/pdo_mysql/tests/bug41125.phpt
@@ -2,17 +2,17 @@
Bug #41125 (PDO mysql + quote() + prepare() can result in seg fault)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$search = "o'";
$sql = "SELECT 1 FROM DUAL WHERE 'o''riley' LIKE " . $db->quote('%' . $search . '%');
diff --git a/ext/pdo_mysql/tests/bug44327.phpt b/ext/pdo_mysql/tests/bug44327.phpt
index cb2fbda097..27a926295c 100644
--- a/ext/pdo_mysql/tests/bug44327.phpt
+++ b/ext/pdo_mysql/tests/bug44327.phpt
@@ -2,14 +2,14 @@
Bug #44327 (PDORow::queryString property & numeric offsets / Crash)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$stmt = $db->prepare("SELECT 1 AS \"one\"");
diff --git a/ext/pdo_mysql/tests/bug46292.phpt b/ext/pdo_mysql/tests/bug46292.phpt
index 8885384f1c..fd2ef759e5 100644
--- a/ext/pdo_mysql/tests/bug46292.phpt
+++ b/ext/pdo_mysql/tests/bug46292.phpt
@@ -2,14 +2,14 @@
Bug #46292 (PDO::setFetchMode() shouldn't requires the 2nd arg when using FETCH_CLASSTYPE)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$pdoDb = MySQLPDOTest::factory();
@@ -51,7 +51,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS testz');
?>
diff --git a/ext/pdo_mysql/tests/bug53551.phpt b/ext/pdo_mysql/tests/bug53551.phpt
index 865dceaa1b..cb7e0fa2b6 100644
--- a/ext/pdo_mysql/tests/bug53551.phpt
+++ b/ext/pdo_mysql/tests/bug53551.phpt
@@ -2,8 +2,8 @@
Bug #44327 (PDORow::queryString property & numeric offsets / Crash)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
diff --git a/ext/pdo_mysql/tests/bug53782.phpt b/ext/pdo_mysql/tests/bug53782.phpt
index 4f81cceef2..6620abc065 100644
--- a/ext/pdo_mysql/tests/bug53782.phpt
+++ b/ext/pdo_mysql/tests/bug53782.phpt
@@ -3,15 +3,15 @@ PDO MySQL Bug #53782 (foreach throws irrelevant exception)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$conn = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$conn = PDOTest::test_factory(__DIR__ . '/common.phpt');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@@ -31,7 +31,7 @@ echo "DONE";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/bug54929.phpt b/ext/pdo_mysql/tests/bug54929.phpt
index d7b4c7ad7f..6f2c2b0b80 100644
--- a/ext/pdo_mysql/tests/bug54929.phpt
+++ b/ext/pdo_mysql/tests/bug54929.phpt
@@ -2,17 +2,17 @@
Bug #54929 (Parse error with single quote in sql comment (pdo-mysql))
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
-$pdodb = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+$pdodb = PDOTest::test_factory(__DIR__ . '/common.phpt');
function testQuery($query) {
diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt
index c5be644450..ed462c0c53 100644
--- a/ext/pdo_mysql/tests/bug63176.phpt
+++ b/ext/pdo_mysql/tests/bug63176.phpt
@@ -2,13 +2,13 @@
Bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc');
+require(__DIR__. DIRECTORY_SEPARATOR . 'config.inc');
class PDO2 extends PDO {
protected $transLevel;
}
diff --git a/ext/pdo_mysql/tests/bug66141.phpt b/ext/pdo_mysql/tests/bug66141.phpt
index bddf08e9f2..6d16a14a1c 100644
--- a/ext/pdo_mysql/tests/bug66141.phpt
+++ b/ext/pdo_mysql/tests/bug66141.phpt
@@ -2,8 +2,8 @@
Bug #66141 (mysqlnd quote function is wrong with NO_BACKSLASH_ESCAPES after failed query)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
diff --git a/ext/pdo_mysql/tests/bug68371.phpt b/ext/pdo_mysql/tests/bug68371.phpt
index 77ddc3183e..f5046f0375 100644
--- a/ext/pdo_mysql/tests/bug68371.phpt
+++ b/ext/pdo_mysql/tests/bug68371.phpt
@@ -2,13 +2,13 @@
PDO MySQL Bug #38671 (PDO#getAttribute() cannot be called with platform-specific attribute names)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$pdo = MySQLPDOTest::factory();
$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
diff --git a/ext/pdo_mysql/tests/bug70272.phpt b/ext/pdo_mysql/tests/bug70272.phpt
index cd9b9d7da2..eba1203868 100644
--- a/ext/pdo_mysql/tests/bug70272.phpt
+++ b/ext/pdo_mysql/tests/bug70272.phpt
@@ -2,8 +2,8 @@
Bug #70272 (Segfault in pdo_mysql)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--INI--
@@ -12,11 +12,11 @@ report_memleaks=off
<?php
$a = new Stdclass();
$a->a = &$a;
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dummy = new StdClass();
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$dummy = NULL;
$a->c = $db;
diff --git a/ext/pdo_mysql/tests/bug70389.phpt b/ext/pdo_mysql/tests/bug70389.phpt
index 2245459b94..09f439804e 100644
--- a/ext/pdo_mysql/tests/bug70389.phpt
+++ b/ext/pdo_mysql/tests/bug70389.phpt
@@ -2,13 +2,13 @@
Bug #70389 (PDO constructor changes unrelated variables)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc');
+require(__DIR__. DIRECTORY_SEPARATOR . 'config.inc');
$flags = [
PDO::MYSQL_ATTR_FOUND_ROWS => true,
PDO::MYSQL_ATTR_LOCAL_INFILE => true,
diff --git a/ext/pdo_mysql/tests/bug70862.phpt b/ext/pdo_mysql/tests/bug70862.phpt
index 527d9544de..d54d19f17b 100644
--- a/ext/pdo_mysql/tests/bug70862.phpt
+++ b/ext/pdo_mysql/tests/bug70862.phpt
@@ -2,13 +2,13 @@
MySQL Prepared Statements and BLOBs
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
@@ -37,7 +37,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/bug71569.phpt b/ext/pdo_mysql/tests/bug71569.phpt
index 32c14b4622..15dfd82cd1 100644
--- a/ext/pdo_mysql/tests/bug71569.phpt
+++ b/ext/pdo_mysql/tests/bug71569.phpt
@@ -2,13 +2,13 @@
Bug #71569 (#70389 fix causes segmentation fault)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc');
+require(__DIR__. DIRECTORY_SEPARATOR . 'config.inc');
try {
new PDO(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, [
diff --git a/ext/pdo_mysql/tests/bug75177.phpt b/ext/pdo_mysql/tests/bug75177.phpt
index abdfd3954b..3a9127cb1e 100644
--- a/ext/pdo_mysql/tests/bug75177.phpt
+++ b/ext/pdo_mysql/tests/bug75177.phpt
@@ -2,13 +2,13 @@
PDO MySQL Bug #75177 Type 'bit' is fetched as unexpected string
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$pdo = MySQLPDOTest::factory();
$tbl = "tbl_bug75177";
diff --git a/ext/pdo_mysql/tests/bug77289.phpt b/ext/pdo_mysql/tests/bug77289.phpt
index db67524260..e8ea91262e 100644
--- a/ext/pdo_mysql/tests/bug77289.phpt
+++ b/ext/pdo_mysql/tests/bug77289.phpt
@@ -2,13 +2,13 @@
Bug #77289: PDO MySQL segfaults with persistent connection
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
index bd193fa9ac..0755112f5f 100644
--- a/ext/pdo_mysql/tests/bug_33689.phpt
+++ b/ext/pdo_mysql/tests/bug_33689.phpt
@@ -3,15 +3,15 @@ PDO MySQL Bug #33689 (query() execute() and fetch() return false on valid select
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->exec('CREATE TABLE test (bar INT NOT NULL)');
$db->exec('INSERT INTO test VALUES(1)');
@@ -36,7 +36,7 @@ print_r($tmp);
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt
index 6a51233cc4..d43bedd619 100644
--- a/ext/pdo_mysql/tests/bug_37445.phpt
+++ b/ext/pdo_mysql/tests/bug_37445.phpt
@@ -3,14 +3,14 @@ PDO MySQL Bug #37445 (Premature stmt object destruction)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
$stmt = $db->prepare("SELECT 1");
diff --git a/ext/pdo_mysql/tests/bug_39483.phpt b/ext/pdo_mysql/tests/bug_39483.phpt
index 559cad65ba..e0f1fd2ea3 100644
--- a/ext/pdo_mysql/tests/bug_39483.phpt
+++ b/ext/pdo_mysql/tests/bug_39483.phpt
Binary files differ
diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt
index ec4c9586cc..db8afa99b8 100644
--- a/ext/pdo_mysql/tests/bug_39858.phpt
+++ b/ext/pdo_mysql/tests/bug_39858.phpt
@@ -3,8 +3,8 @@ Bug #39858 (Lost connection to MySQL server during query by a repeated call stor
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -13,16 +13,16 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--XFAIL--
nextRowset() problem with stored proc & emulation mode & mysqlnd
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
@@ -66,7 +66,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->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 a1d8dd1ae4..e341ed409c 100644
--- a/ext/pdo_mysql/tests/bug_41125.phpt
+++ b/ext/pdo_mysql/tests/bug_41125.phpt
@@ -2,8 +2,8 @@
Bug #41125 (PDO mysql + quote() + prepare() can result in segfault)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -12,15 +12,15 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
die("skip $version");
if ($version < 40100)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->exec("DROP TABLE IF EXISTS test");
@@ -40,7 +40,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec("DROP TABLE IF EXISTS test");
?>
diff --git a/ext/pdo_mysql/tests/bug_41698.phpt b/ext/pdo_mysql/tests/bug_41698.phpt
index 637a0910b1..5b60da9daa 100644
--- a/ext/pdo_mysql/tests/bug_41698.phpt
+++ b/ext/pdo_mysql/tests/bug_41698.phpt
@@ -3,15 +3,15 @@ PDO MySQL Bug #41698 (float parameters truncated to integer in prepared statemen
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
setlocale(LC_ALL, "de","de_DE","de_DE.ISO8859-1","de_DE.ISO_8859-1","de_DE.UTF-8");
diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt
index 3a90244365..e3b52944be 100644
--- a/ext/pdo_mysql/tests/bug_41997.phpt
+++ b/ext/pdo_mysql/tests/bug_41997.phpt
@@ -4,8 +4,8 @@ PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks futur
nextRowset() problem with stored proc & emulation mode & mysqlnd
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -14,14 +14,14 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->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 e218e0c14e..244101a7ae 100644
--- a/ext/pdo_mysql/tests/bug_42499.phpt
+++ b/ext/pdo_mysql/tests/bug_42499.phpt
@@ -3,8 +3,8 @@ Bug #42499 (Multi-statement execution via PDO::exec() makes connection unusable)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
@@ -15,13 +15,13 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 41000)
die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function bug_42499($db) {
diff --git a/ext/pdo_mysql/tests/bug_43371.phpt b/ext/pdo_mysql/tests/bug_43371.phpt
index 88c3a9bc6f..80c2149f61 100644
--- a/ext/pdo_mysql/tests/bug_43371.phpt
+++ b/ext/pdo_mysql/tests/bug_43371.phpt
@@ -2,13 +2,13 @@
Bug #43371 (Memory errors in PDO constructor)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$db = new PDO($dsn, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true));
diff --git a/ext/pdo_mysql/tests/bug_44454.phpt b/ext/pdo_mysql/tests/bug_44454.phpt
index eb93d97952..d21cf3a4e2 100644
--- a/ext/pdo_mysql/tests/bug_44454.phpt
+++ b/ext/pdo_mysql/tests/bug_44454.phpt
@@ -3,15 +3,15 @@ Bug #44454 (Unexpected exception thrown in foreach() statement)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
function bug_44454($db) {
@@ -69,7 +69,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/bug_44707.phpt b/ext/pdo_mysql/tests/bug_44707.phpt
index dff7e7c745..60f4ccdfae 100644
--- a/ext/pdo_mysql/tests/bug_44707.phpt
+++ b/ext/pdo_mysql/tests/bug_44707.phpt
@@ -3,8 +3,8 @@ Bug #44707 (The MySQL PDO driver resets variable content after bindParam on tiny
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
@@ -15,16 +15,16 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 41000)
die(sprintf("skip Will work different with MySQL Server < 4.1.0, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
function bug_44707($db) {
diff --git a/ext/pdo_mysql/tests/bug_45120.phpt b/ext/pdo_mysql/tests/bug_45120.phpt
index db5da823f7..bc2ea76629 100644
--- a/ext/pdo_mysql/tests/bug_45120.phpt
+++ b/ext/pdo_mysql/tests/bug_45120.phpt
@@ -3,15 +3,15 @@ Bug #45120 (PDOStatement->execute() returns true then false for same statement)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
function bug_45120($db) {
diff --git a/ext/pdo_mysql/tests/bug_50323.phpt b/ext/pdo_mysql/tests/bug_50323.phpt
index 30f856efc8..3997ccf398 100644
--- a/ext/pdo_mysql/tests/bug_50323.phpt
+++ b/ext/pdo_mysql/tests/bug_50323.phpt
@@ -3,14 +3,14 @@ Bug #50323 (No ability to connect to database named 't;', no chance to escape se
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
function changeDSN($original, $new_options) {
$old_options = array();
@@ -51,8 +51,8 @@ echo 'done!';
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
@$db->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 b2a1219991..22b3e63470 100644
--- a/ext/pdo_mysql/tests/bug_51670.phpt
+++ b/ext/pdo_mysql/tests/bug_51670.phpt
@@ -3,14 +3,14 @@ Bug #51670 (getColumnMeta causes segfault when re-executing query after calling
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$query = $db->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 411b39a70b..346c1687e7 100644
--- a/ext/pdo_mysql/tests/bug_61207.phpt
+++ b/ext/pdo_mysql/tests/bug_61207.phpt
@@ -2,14 +2,14 @@
PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->query('DROP TABLE IF EXISTS test');
@@ -84,7 +84,7 @@ $db->query("DROP TABLE test");
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/bug_61411.phpt b/ext/pdo_mysql/tests/bug_61411.phpt
index d840f222f1..c5df174997 100644
--- a/ext/pdo_mysql/tests/bug_61411.phpt
+++ b/ext/pdo_mysql/tests/bug_61411.phpt
@@ -3,8 +3,8 @@ Bug #61411 (PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -13,14 +13,14 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 40106)
die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$attr = getenv('PDOTEST_ATTR');
if (!$attr) {
diff --git a/ext/pdo_mysql/tests/bug_61755.phpt b/ext/pdo_mysql/tests/bug_61755.phpt
index a6f55f5938..ccd8a964dd 100644
--- a/ext/pdo_mysql/tests/bug_61755.phpt
+++ b/ext/pdo_mysql/tests/bug_61755.phpt
@@ -3,14 +3,14 @@ Bug #61755 (A parsing bug in the prepared statements can lead to access violatio
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->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 1d2acfdc69..5abc546d15 100644
--- a/ext/pdo_mysql/tests/bug_74376.phpt
+++ b/ext/pdo_mysql/tests/bug_74376.phpt
@@ -3,13 +3,13 @@ Bug #74376 (Invalid free of persistent results on error/connection loss)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$attr = getenv('PDOTEST_ATTR');
$attr = $attr ? unserialize($attr) : [];
diff --git a/ext/pdo_mysql/tests/bug_pecl_12925.phpt b/ext/pdo_mysql/tests/bug_pecl_12925.phpt
index a893fb81b7..361ef719d0 100644
--- a/ext/pdo_mysql/tests/bug_pecl_12925.phpt
+++ b/ext/pdo_mysql/tests/bug_pecl_12925.phpt
@@ -3,14 +3,14 @@ PDO MySQL PECL bug #1295 (http://pecl.php.net/bugs/bug.php?id=12925)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function bug_pecl_1295($db) {
diff --git a/ext/pdo_mysql/tests/bug_pecl_7976.phpt b/ext/pdo_mysql/tests/bug_pecl_7976.phpt
index 8a1362599b..9eb50abd43 100644
--- a/ext/pdo_mysql/tests/bug_pecl_7976.phpt
+++ b/ext/pdo_mysql/tests/bug_pecl_7976.phpt
@@ -3,8 +3,8 @@ PECL Bug #7976 (Calling stored procedure several times)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -13,14 +13,14 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function bug_pecl_7976($db) {
@@ -52,7 +52,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP PROCEDURE IF EXISTS p');
?>
diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt
index f55d1f883b..0d002546e0 100644
--- a/ext/pdo_mysql/tests/common.phpt
+++ b/ext/pdo_mysql/tests/common.phpt
@@ -1,7 +1,7 @@
--TEST--
MySQL
--SKIPIF--
-<?php # vim:ft=php
+<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded';
?>
--REDIRECTTEST--
diff --git a/ext/pdo_mysql/tests/last_insert_id.phpt b/ext/pdo_mysql/tests/last_insert_id.phpt
index c819efe1e6..4b32d1cda2 100644
--- a/ext/pdo_mysql/tests/last_insert_id.phpt
+++ b/ext/pdo_mysql/tests/last_insert_id.phpt
@@ -3,14 +3,14 @@ PDO MySQL auto_increment / last insert id
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
print_r($db->query("CREATE TABLE test (id int auto_increment primary key, num int)"));
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
index 219678c671..b849f274be 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
@@ -2,13 +2,13 @@
MySQL PDO->__construct() - Generic + DSN
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function tryandcatch($offset, $code) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
index e24f66c09d..a03ad7f324 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
@@ -2,8 +2,8 @@
MySQL PDO->__construct() - URI
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
/* TODO - fix this limitation */
if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysql.sock")
@@ -13,7 +13,7 @@ if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysq
pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$found = false;
$values = ini_get_all();
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
index 08cd8eb942..b7a52127c5 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
@@ -2,13 +2,13 @@
MySQL PDO->__construct(), options
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function set_option_and_check($offset, $option, $value, $option_desc) {
@@ -76,9 +76,7 @@ MySQLPDOTest::skip();
if (!is_object($db = new PDO($dsn, $user, $pass, array())))
printf("[002] Expecting object got %s/%s¸\n", gettype($db), $db);
- do {
- $invalid = mt_rand(-1000, 1000);
- } while (isset($valid_options[$invalid]));
+ $invalid = 999;
if (is_object($db = new PDO($dsn, $user, $pass, array($invalid => true))))
printf("[003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!\n");
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 133d42215d..d01ef0a69a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
@@ -2,15 +2,15 @@
MySQL PDO->__construct(), libmysql only options
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
if (MySQLPDOTest::isPDOMySQLnd())
die("skip libmysql only options")
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function set_option_and_check($offset, $option, $value, $option_desc, $ignore_diff = false) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
index afb765c129..7418033768 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
@@ -2,13 +2,13 @@
MySQL PDO->__construct() - URI
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
try {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
index 95e6ff9875..361750260b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_AUTOCOMMIT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
// autocommit should be on by default
@@ -91,7 +91,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
index 6c39467b12..a011c864c5 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_CASE
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -86,7 +86,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 19831da979..ce50df80eb 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_CLIENT_VERSION
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
assert(('' == $db->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 9fd9bf9b26..8abb16a1c7 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_CONNECTION_STATUS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$status = $db->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 708e3a2efc..65ab531ffd 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_DRIVER_NAME
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
assert(('' == $db->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 4db50f074f..f0dc29b8d4 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt
@@ -2,8 +2,8 @@
PDO::ATTR_ERRMODE
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
@@ -11,7 +11,7 @@ $db = MySQLPDOTest::factory();
error_reporting=E_ALL
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$valid = array(PDO::ERRMODE_SILENT, PDO::ERRMODE_WARNING, PDO::ERRMODE_EXCEPTION);
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 b85ba236f8..a19e680de1 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
@@ -2,13 +2,13 @@
PDO::ATTR_FETCH_TABLE_NAMES
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
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 4ef6e52976..cd3b40d6d1 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
@@ -2,8 +2,8 @@
PDO::MYSQL_ATTR_INIT_COMMAND
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
@@ -11,7 +11,7 @@ $db = MySQLPDOTest::factory();
error_reporting=E_ALL
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
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 c9aa5aaac4..c988b2b3cb 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
@@ -2,15 +2,15 @@
MySQL PDO->__construct(), PDO::MYSQL_ATTR_MAX_BUFFER_SIZE
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
if (MySQLPDOTest::isPDOMySQLnd())
die("skip PDO::MYSQL_ATTR_MAX_BUFFER_SIZE not supported with mysqlnd");
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function try_buffer_size($offset, $buffer_size) {
@@ -65,7 +65,7 @@ if (MySQLPDOTest::isPDOMySQLnd())
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 b10e82afcb..92bab1d30d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_multi_statements.phpt
@@ -2,8 +2,8 @@
PDO::MYSQL_ATTR_MULTI_STATEMENTS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
@@ -11,7 +11,7 @@ $db = MySQLPDOTest::factory();
error_reporting=E_ALL
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
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 3a937c7dee..44503c1053 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
@@ -2,13 +2,13 @@
PDO::ATTR_ORACLE_NULLS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt
index 41dcf06f40..f1ca4be1de 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_prefetch.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_PREFETCH
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
var_dump($db->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 9c3087384b..4a142eee38 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_SERVER_INFO
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
assert(('' == $db->errorCode()) || ('00000' == $db->errorCode()));
@@ -40,8 +40,11 @@ $db = MySQLPDOTest::factory();
if (!preg_match('/Uptime/i', $info))
printf("[006] Can't find uptime in server info '%s'\n", $info);
- if (isset($uptime) && !preg_match(sprintf('/Uptime: %d/i', $uptime), $info))
- printf("[007] SHOW STATUS and server info have reported a different uptime, please check. Server info: '%s', SHOW STATUS: '%s'\n", $info, $uptime);
+ if (isset($uptime)) {
+ if (!preg_match('/Uptime: (\d+)/i', $info, $matches) || $uptime - $matches[1] > 1) {
+ printf("[007] SHOW STATUS and server info have reported a different uptime, please check. Server info: '%s', SHOW STATUS: '%s'\n", $info, $uptime);
+ }
+ }
print "done!";
--EXPECT--
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 0a50c8d46a..a635c3771a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_SERVER_VERSION
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
assert(('' == $db->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 e280ded294..ddc76d4b60 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
@@ -2,14 +2,14 @@
PDO::ATTR_STATEMENT_CLASS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
diff --git a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
index 1cd24f0dbf..f2653f4b6b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
@@ -2,8 +2,8 @@
PDO->beginTransaction()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
@@ -11,7 +11,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -183,7 +183,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
index f27e3d8c78..caa81e96ac 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
@@ -2,8 +2,8 @@
MySQL PDO->exec(), BIT columns - remove after fix!
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
if (MySQLPDOTest::isPDOMySQLnd())
die("skip Known bug - mysqlnd handles BIT incorrectly!");
@@ -11,7 +11,7 @@ if (MySQLPDOTest::isPDOMySQLnd())
--FILE--
<?php
/* TODO: remove this test after fix and enable the BIT test in pdo_mysql_types.phpt again */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function test_type(&$db, $offset, $sql_type, $value, $ret_value = NULL, $pattern = NULL) {
@@ -49,7 +49,7 @@ if (MySQLPDOTest::isPDOMySQLnd())
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
index 090f97d043..05f3151e8b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
@@ -2,16 +2,16 @@
PDO MySQL specific class constants
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) {
/* Need connection to detect library version */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
}
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$expected = array(
'MYSQL_ATTR_USE_BUFFERED_QUERY' => true,
diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
index 2219ae8ed4..6141ff611b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
@@ -2,8 +2,8 @@
MySQL PDO->commit()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
@@ -11,7 +11,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -81,7 +81,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
print "done!";
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test_commit');
MySQLPDOTest::dropTestTable($db);
diff --git a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
index f7dede52ef..84ce556d32 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt
@@ -2,13 +2,13 @@
PDO_MYSQL: Defining a connection charset in the DSN
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
/* Connect to mysql to determine the current charset so we can diffinate it */
$link = MySQLPDOTest::factory();
diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
index a974f29df9..5bf6c10448 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
@@ -2,14 +2,14 @@
MySQL PDO->errorCode()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -79,7 +79,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
index dca3b2305b..487f8ab97a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
@@ -2,14 +2,14 @@
MySQL PDO->errorInfo()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -98,7 +98,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
index 983073782e..71d93815ff 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
@@ -2,8 +2,8 @@
MySQL PDO->exec(), affected rows
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
@@ -29,7 +29,7 @@ MySQLPDOTest::skip();
return true;
}
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -174,7 +174,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
@$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
index 8afd07bef0..0b2428cc1c 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
@@ -2,8 +2,8 @@
MySQL PDO->exec(), affected rows
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
@@ -33,7 +33,7 @@ MySQLPDOTest::skip();
return true;
}
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -79,7 +79,7 @@ MySQLPDOTest::skip();
print "done!";
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
MySQLPDOTest::dropTestTable($db);
// clean up
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 e1ca9e1e16..50b35618b3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
@@ -2,8 +2,8 @@
MySQL PDO->exec(), affected rows
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
// Run test only locally - not against remote hosts
@@ -58,7 +58,7 @@ if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
return true;
}
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . 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));
@@ -112,7 +112,7 @@ if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
index f8900a0ef3..901a4ad9a8 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
@@ -2,8 +2,8 @@
MySQL PDO->exec(), SELECT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
@@ -29,7 +29,7 @@ MySQLPDOTest::skip();
return true;
}
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -55,7 +55,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
@$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
index 9303a3119d..0e53d40deb 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->fetch()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function fetch($offset, &$db, $query, $expect = null) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
index 8ab2c98b4c..51310faa9e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
@@ -2,8 +2,8 @@
MySQL PDO->getAttribute()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
@@ -11,17 +11,10 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
- function find_invalid_int($valid_options) {
- do {
- $invalid = mt_rand(-10000, 10000);
- } while (in_array($invalid, $valid_options));
- return $invalid;
- }
-
function set_and_get($offset, $db, $attribute, $value) {
$value_type = gettype($value);
@@ -98,7 +91,7 @@ PDO::ATTR_SERVER_INFO
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_interface.phpt b/ext/pdo_mysql/tests/pdo_mysql_interface.phpt
index 24b19ae3f7..cc949b265d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_interface.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_interface.phpt
@@ -2,8 +2,8 @@
MySQL PDO class interface
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
@@ -11,7 +11,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$expected = array(
@@ -29,8 +29,6 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
'getAttribute' => true,
'quote' => true,
'inTransaction' => true,
- '__wakeup' => true,
- '__sleep' => true,
'getAvailableDrivers' => true,
);
$classname = get_class($db);
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 0ce9e1e539..d9dec0bcd3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
@@ -2,14 +2,14 @@
MySQL PDO->lastInsertId()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -112,7 +112,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 5a0b5f67e0..1f1e6d9668 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
@@ -2,16 +2,16 @@
ensure default for local infile is off
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
if (!MYSQLPDOTest::isPDOMySQLnd())
die("skip mysqlnd only test");
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'config.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
@@ -21,6 +21,6 @@ $db = new PDO($dsn, $user, $pass);
echo var_export($db->getAttribute(PDO::MYSQL_ATTR_LOCAL_INFILE)), "\n";
echo "done!\n";
?>
---EXPECTF--
+--EXPECT--
false
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 4394bc0576..13df9024a2 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
@@ -2,16 +2,16 @@
enable local infile
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
if (!MYSQLPDOTest::isPDOMySQLnd())
die("skip mysqlnd only test");
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'config.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
@@ -21,6 +21,6 @@ $db = new PDO($dsn, $user, $pass, array(PDO::MYSQL_ATTR_LOCAL_INFILE => true));
echo var_export($db->getAttribute(PDO::MYSQL_ATTR_LOCAL_INFILE)), "\n";
echo "done!\n";
?>
---EXPECTF--
+--EXPECT--
true
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
index 6398a83928..f520c1d828 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_multi_stmt_nextrowset.phpt
@@ -2,8 +2,8 @@
MySQL PDOStatement->nextRowSet() with PDO::MYSQL_ATTR_MULTI_STATEMENTS either true or false
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
$row = $db->query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC);
@@ -11,17 +11,17 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
if (!MySQLPDOTest::isPDOMySQLnd())
die("skip This will not work with libmysql");
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
@@ -83,7 +83,7 @@ if (!MySQLPDOTest::isPDOMySQLnd())
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
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 56b94483f3..01964c0cd9 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_param_str_natl.phpt
@@ -3,15 +3,15 @@ PDO MySQL national character set parameters don't affect true prepared statement
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
@@ -29,7 +29,7 @@ foreach ($db->query('SELECT * from test') as $row) {
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
index 880f10b875..3656e71a0c 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
@@ -2,13 +2,13 @@
MySQL PDO->__construct(), PDO::ATTR_PERSISTENT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
try {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
index 74b4a73584..a230b3c19f 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
@@ -2,14 +2,14 @@
MySQL PDO phpinfo() output
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
ob_start();
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
index 437ea7a458..8db812ee19 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), emulated PS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function prepex($offset, &$db, $query, $input_params = null, $error_info = null) {
@@ -320,7 +320,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 3f63ffcb01..e8b5cb39ae 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), emulated PS, anonymous placeholder
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -60,7 +60,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 3a77d5eee1..5ad3c85641 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), emulated PS, anonymous placeholder
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
// TODO: This test is MySQL version specific - for whatever reason
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -56,7 +56,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 958068f035..0e7dc4b3ab 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
@@ -2,8 +2,8 @@
MySQL PDO->prepare() and 1295 (ER_UNSUPPORTED_PS)
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
// Run test only locally - not against remote hosts
@@ -58,7 +58,7 @@ if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
return true;
}
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
// Run with native PS.
// The test is about checking the fallback to emulation
@@ -116,7 +116,7 @@ if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
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 12cf051647..f77c420d67 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
@@ -2,13 +2,13 @@
Bug #41876 (bindParam() and bindValue() do not work with MySQL MATCH () AGAINST ())
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -40,7 +40,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
index 13b9034788..efd472edc6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function prepex($offset, &$db, $query, $input_params = null, $error_info = null, $suppress_warning = false) {
@@ -233,7 +233,7 @@ $db = MySQLPDOTest::factory();
prepex(44, $db, 'DELETE FROM test');
prepex(45, $db, 'INSERT INTO test(id, label) VALUES (1, ?), (2, ?)',
array('row', 'row'));
- $stmt = prepex(46, $db, 'SELECT id, label FROM test');
+ $stmt = prepex(46, $db, 'SELECT id, label FROM test ORDER BY id');
$tmp = $stmt->fetchAll(PDO::FETCH_ASSOC);
$exp = array(
0 => array(
@@ -337,7 +337,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 000e44b731..48bd33fda5 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS, clear line after error
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -70,7 +70,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 8a942d0d32..1ee1c3a43b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS, named placeholder
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -30,7 +30,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 e382dff375..c9465b62a2 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS, named placeholder II
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -96,7 +96,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 d56f7c6549..e706b92616 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS, mixed, wired style
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -28,7 +28,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 896d9cd2a3..12acdcc0b1 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(), native PS, named placeholder
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -68,7 +68,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 442e710e74..8df6961f93 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
@@ -2,14 +2,14 @@
MySQL PDO->prepare(),native PS, anonymous placeholder
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
$db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, 1);
@@ -61,7 +61,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_quote.phpt b/ext/pdo_mysql/tests/pdo_mysql_quote.phpt
index 3d094a4136..efb38ba576 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_quote.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_quote.phpt
@@ -2,13 +2,13 @@
MySQL ensure quote function returns expected results
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
var_dump($db->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 108975bcf8..30f1d56f88 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
@@ -2,8 +2,8 @@
PDO::rollBack()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
@@ -11,7 +11,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
@@ -83,7 +83,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
$db->exec('DROP TABLE IF EXISTS test2');
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
index 1dd3ca0fa6..bf56cbc835 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->bindColumn()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -103,7 +103,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
index 4c3716de4b..422c519355 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
@@ -2,13 +2,13 @@
MySQL PDOStatement->bindParam()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
@@ -118,7 +118,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 c23ef4b2fd..c6860fa539 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->bindParam() - SQL column types
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -166,7 +166,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
index 42f01d5332..173105a48e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->bindValue()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -297,7 +297,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
index 2dedf35958..bea8773a23 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
@@ -2,8 +2,8 @@
MySQL PDOStatement - inserting BLOB from stream
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$tmp = MySQLPDOTest::getTempDir();
@@ -28,7 +28,7 @@ unlink($file);
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function blob_from_stream($offset, $db, $file, $blob) {
@@ -137,7 +137,7 @@ unlink($file);
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
@unlink(MySQLPDOTest::getTempDir() . DIRECTORY_SEPARATOR . 'pdoblob.tst');
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
index bec8b70caf..a247de534e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
@@ -2,13 +2,13 @@
MySQL Prepared Statements and BLOBs
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$blobs = array(
@@ -90,7 +90,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
index 455b17d1ef..d0da7a8e16 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
@@ -2,15 +2,15 @@
MySQL PDOStatement->closeCursor()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
/* TODO the results look wrong, why do we get 2014 with buffered AND unbuffered queries */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function pdo_mysql_stmt_closecursor($db) {
@@ -146,7 +146,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 6b4e4d225f..77f663584a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->closeCursor()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
@@ -63,7 +63,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
index 69e0d35e17..a701469ed1 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->columnCount()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -56,7 +56,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECT--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
index b4c75ebee1..f77ba60f75 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->errorCode();
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->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 9254568db0..e9dbeab3a6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
@@ -2,14 +2,14 @@
MySQL PDOStatement->errorInfo();
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -61,7 +61,7 @@ $db = MySQLPDOTest::factory();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 255cd383a6..46ab4f911c 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
@@ -2,13 +2,13 @@
MySQL PDOStatement->execute()/fetch(), Non-SELECT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -184,7 +184,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 f23f9572c1..37dda2c0f5 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
@@ -2,13 +2,13 @@
MySQL PDOStatement->fetch(), PDO::FETCH_SERIALIZE
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -115,7 +115,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
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 890c7b73cb..bfc907dbcb 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
@@ -2,13 +2,13 @@
MySQL PDOStatement->fetch(), PDO::FETCH_SERIALIZE
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
index e35f95a86f..ae14c056f3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
@@ -2,8 +2,8 @@
MySQL PDO: PDOStatement->fetchObject()
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -19,7 +19,7 @@ if (!$ok)
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -77,7 +77,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt
index 82806ce479..529858fc2b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt
@@ -1,9 +1,9 @@
--TEST--
MySQL: PDOStatement->getColumnMeta()
--SKIPIF--
-<?php # vim:ft=php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+<?php
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
// Too many differences among MySQL version - run only with a recent one
$db = MySQLPDOTest::factory();
@@ -15,7 +15,7 @@ if ($version < 51)
?>
--FILE--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
MySQLPDOTest::createTestTable($db);
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
index d2a2316272..9e36714d54 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
@@ -2,13 +2,13 @@
PDOStatements and multi query
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function mysql_stmt_multiquery_wrong_usage($db) {
@@ -53,7 +53,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
index e971ce9513..9452ca8ec5 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
@@ -4,8 +4,8 @@ MySQL PDOStatement->nextRowSet()
nextRowset() problem with stored proc & emulation mode & mysqlnd
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
$row = $db->query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC);
@@ -13,17 +13,17 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
if (!MySQLPDOTest::isPDOMySQLnd())
die("skip This will not work with libmysql");
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
@@ -110,7 +110,7 @@ if (!MySQLPDOTest::isPDOMySQLnd())
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
index 1e89c8900c..713945e98d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
@@ -2,13 +2,13 @@
MySQL PDOStatement->rowCount() @ SELECT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
@@ -29,7 +29,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 1dc203fa9e..35d4ba3cba 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
@@ -2,8 +2,8 @@
MySQL PDO:query() vs. PDO::prepare() and MySQL error 2050
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
if (MYSQLPDOTest::isPDOMySQLnd())
@@ -11,7 +11,7 @@ if (MYSQLPDOTest::isPDOMySQLnd())
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
try {
@@ -112,7 +112,7 @@ if (MYSQLPDOTest::isPDOMySQLnd())
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--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 02f8c682b2..63a500b7b3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
@@ -4,8 +4,8 @@ MySQL Prepared Statements and different column counts
nextRowset() problem with stored proc & emulation mode & mysqlnd
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
$db = MySQLPDOTest::factory();
@@ -14,14 +14,14 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n"));
-$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+$version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
- $matches[0], $matches[1], $matches[2], $version));
+ $matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
function check_result($offset, $stmt, $columns) {
diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
index 773537b12c..604a13bdb3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
@@ -2,17 +2,13 @@
MySQL PDOStatement->execute()/fetch(), Non-SELECT
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
-
- // No silly strict mode warnings, please!
- error_reporting(E_ALL^E_STRICT);
- ini_set('display_errors', false);
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
try {
@@ -23,9 +19,9 @@ MySQLPDOTest::skip();
return call_user_func_array(array($this, 'parent::__construct'), func_get_args());
}
- public function exec() {
+ public function exec($statement) {
$this->protocol();
- return call_user_func_array(array($this, 'parent::exec'), func_get_args());
+ return parent::exec($statement);
}
public function query() {
@@ -74,7 +70,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_types.phpt
index 7fb9fe51ed..fee1aff514 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_types.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_types.phpt
@@ -2,13 +2,13 @@
MySQL PDO->exec(), native types wo ZEROFILL
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function test_type(&$db, $offset, $sql_type, $value, $ret_value = NULL, $pattern = NULL, $alternative_type = NULL) {
@@ -176,7 +176,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
index 1d8c529378..1ef5ab1370 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
@@ -2,13 +2,13 @@
MySQL PDO->exec(), native types - ZEROFILL
--SKIPIF--
<?php
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
function test_type(&$db, $offset, $sql_type, $value, $ret_value = NULL, $pattern = NULL) {
@@ -120,7 +120,7 @@ MySQLPDOTest::skip();
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
index ff5b0e4c3e..d44a5c2282 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
@@ -3,14 +3,14 @@ PDO MySQL PECL Bug #5200 (Describe table gives unexpected result mysql and type
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__. '/common.phpt');
$db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I', 'II', 'IIa', 'IIb', 'III', 'IV'))");
@@ -20,7 +20,7 @@ foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row)
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
index 9ae279eaba..6838cebd37 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
@@ -1,16 +1,16 @@
--TEST--
PDO MySQL PECL Bug #5780 (Failure to produce an error when one is expected)
--SKIPIF--
-<?php # vim:ft=php:
+<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__. '/common.phpt');
$db->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)");
@@ -28,7 +28,7 @@ var_dump($info);
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
$db->exec('DROP TABLE IF EXISTS test2');
diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
index b7cbf78ee7..01e95343c6 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
@@ -1,16 +1,16 @@
--TEST--
PDO MySQL PECL Bug #5802 (bindParam/bindValue retain the is_null flag)
--SKIPIF--
-<?php # vim:ft=php:
+<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__. '/common.phpt');
$db->exec('create table test ( bar char(3) NULL )');
$stmt = $db->prepare('insert into test (bar) values(:bar)') or var_dump($db->errorInfo());
@@ -36,7 +36,7 @@ print "done!";
?>
--CLEAN--
<?php
-require dirname(__FILE__) . '/mysql_pdo_test.inc';
+require __DIR__ . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
?>
diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt
index 1b1ef67680..d6b1337412 100644
--- a/ext/pdo_mysql/tests/show_tables.phpt
+++ b/ext/pdo_mysql/tests/show_tables.phpt
@@ -3,14 +3,14 @@ PDO MySQL SHOW TABLES
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require __DIR__ . '/config.inc';
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
print_r($db->query('SHOW TABLES'));
--EXPECT--