summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-08-11 23:45:13 +0000
committerfoobar <sniper@php.net>2005-08-11 23:45:13 +0000
commit3eaa48b58f2dad6476c3c2fd5cef8cc9850873a1 (patch)
treea3ff23741055d29d4ffdc8e13fdf0e937b778794
parent264cec8be641d1c2ea0c95d915d506c4fdbc751a (diff)
downloadphp-git-3eaa48b58f2dad6476c3c2fd5cef8cc9850873a1.tar.gz
fix skip conditions
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt7
-rw-r--r--ext/pdo_mysql/tests/common.phpt3
-rw-r--r--ext/pdo_mysql/tests/config.inc19
-rw-r--r--ext/pdo_mysql/tests/show_tables.phpt7
4 files changed, 31 insertions, 5 deletions
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
index 5d584a36f9..6df6569564 100644
--- a/ext/pdo_mysql/tests/bug_33689.phpt
+++ b/ext/pdo_mysql/tests/bug_33689.phpt
@@ -1,8 +1,11 @@
--TEST--
PDO MySQL Bug #33689
--SKIPIF--
-<?php # vim:ft=php
-if (!extension_loaded('pdo_mysql')) print 'skip not loaded';
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require 'ext/pdo_mysql/tests/config.inc';
+require 'ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
?>
--FILE--
<?php
diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt
index 4351d9646e..8179454cf7 100644
--- a/ext/pdo_mysql/tests/common.phpt
+++ b/ext/pdo_mysql/tests/common.phpt
@@ -2,7 +2,8 @@
MySQL
--SKIPIF--
<?php # vim:ft=php
-if (!extension_loaded('pdo_mysql')) print 'skip'; ?>
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded';
+?>
--REDIRECTTEST--
# magic auto-configuration
diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc
new file mode 100644
index 0000000000..855f89bc1e
--- /dev/null
+++ b/ext/pdo_mysql/tests/config.inc
@@ -0,0 +1,19 @@
+<?php
+
+if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
+ if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
+ }
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'root';
+ $config['ENV']['PDOTEST_PASS'] = '';
+}
+
+foreach ($config['ENV'] as $k => $v) {
+ putenv("$k=$v");
+}
diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt
index 8919b6b778..dc95d5f5f7 100644
--- a/ext/pdo_mysql/tests/show_tables.phpt
+++ b/ext/pdo_mysql/tests/show_tables.phpt
@@ -1,8 +1,11 @@
--TEST--
PDO MySQL SHOW TABLES
--SKIPIF--
-<?php # vim:ft=php
-if (!extension_loaded('pdo_mysql')) print 'skip not loaded';
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require 'ext/pdo_mysql/tests/config.inc';
+require 'ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
?>
--FILE--
<?php