Author: uwendel
Date: 2007-10-12 11:47:15 +0200 (Fri, 12 Oct 2007)
New Revision: 1095
Modified:
trunk/tests/ext/mysql/002.phpt
trunk/tests/ext/mysql/003.phpt
trunk/tests/ext/mysql/connect.inc
trunk/tests/ext/mysql/mysql_affected_rows.phpt
trunk/tests/ext/mysql/mysql_client_encoding.phpt
trunk/tests/ext/mysql/mysql_close.phpt
trunk/tests/ext/mysql/mysql_constants.phpt
trunk/tests/ext/mysql/mysql_data_seek.phpt
trunk/tests/ext/mysql/mysql_db_name.phpt
trunk/tests/ext/mysql/mysql_db_query.phpt
trunk/tests/ext/mysql/mysql_errno.phpt
trunk/tests/ext/mysql/mysql_error.phpt
trunk/tests/ext/mysql/mysql_max_persistent.phpt
trunk/tests/ext/mysql/mysql_trace_mode.phpt
trunk/tests/ext/mysql/skipifconnectfailure.inc
Log:
Upon request by php.net: skip if we can't connect
Modified: trunk/tests/ext/mysql/002.phpt
===================================================================
--- trunk/tests/ext/mysql/002.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/002.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_fetch_array
--SKIPIF--
-<?php include 'skipif.inc'; ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
require_once('connect.inc');
Modified: trunk/tests/ext/mysql/003.phpt
===================================================================
--- trunk/tests/ext/mysql/003.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/003.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_fetch_object
--SKIPIF--
-<?php include 'skipif.inc'; ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include_once('connect.inc');
Modified: trunk/tests/ext/mysql/connect.inc
===================================================================
--- trunk/tests/ext/mysql/connect.inc 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/connect.inc 2007-10-12 09:47:15 UTC (rev 1095)
@@ -43,7 +43,7 @@
}
/*
-Default values are "localhost", "root", database "phptest" and empty password.
+Default values are "localhost", "root", database "test" and empty password.
Change the MYSQL_TEST_* environment values if you want to use another configuration.
*/
@@ -54,6 +54,7 @@
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
+$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ?
getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
/* Development setting: test experimal features and/or feature requests that never worked
before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
Modified: trunk/tests/ext/mysql/mysql_affected_rows.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_affected_rows.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_affected_rows.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_affected_rows()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include_once("connect.inc");
Modified: trunk/tests/ext/mysql/mysql_client_encoding.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_client_encoding.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_client_encoding.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_client_encoding()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include_once "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_close.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_close.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_close.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_close()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_constants.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_constants.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_constants.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
Constants exported by ext/mysql
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
require("connect.inc");
Modified: trunk/tests/ext/mysql/mysql_data_seek.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_data_seek.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_data_seek.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_data_seek()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_db_name.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_db_name.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_db_name.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_db_name()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_db_query.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_db_query.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_db_query.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_db_query()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_errno.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_errno.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_errno.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_errno()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_error.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_error.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_error.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql_error()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--FILE--
<?php
include "connect.inc";
Modified: trunk/tests/ext/mysql/mysql_max_persistent.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_max_persistent.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_max_persistent.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -3,6 +3,7 @@
--SKIPIF--
<?php
require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
require_once('connect.inc');
$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket);
Modified: trunk/tests/ext/mysql/mysql_trace_mode.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_trace_mode.phpt 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/mysql_trace_mode.phpt 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,7 +1,10 @@
--TEST--
mysql.trace_mode=1
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
--INI--
mysql.trace_mode=1
error_reporting=E_ALL | E_NOTICE | E_STRICT
Modified: trunk/tests/ext/mysql/skipifconnectfailure.inc
===================================================================
--- trunk/tests/ext/mysql/skipifconnectfailure.inc 2007-10-12 09:46:34 UTC (rev 1094)
+++ trunk/tests/ext/mysql/skipifconnectfailure.inc 2007-10-12 09:47:15 UTC (rev 1095)
@@ -1,17 +1,17 @@
<?php
-$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ?
getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : false;
+require_once('connect.inc');
if ($skip_on_connect_failure) {
if ($socket)
$myhost = sprintf("%s:%s", $host, $socket);
else if ($port)
$myhost = sprintf("%s:%s", $host, $port);
-
+
if (!$link = @mysql_connect($myhost, $user, $passwd, true))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(),
mysql_error()));
if (!@mysql_select_db($db, $link))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(),
mysql_error()));
-
+
mysql_close($link);
}
?>
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r1095 - trunk/tests/ext/mysql | uwendel | 12 Oct |