]> granicus.if.org Git - php/commitdiff
fix skip conditions
authorfoobar <sniper@php.net>
Thu, 11 Aug 2005 23:45:13 +0000 (23:45 +0000)
committerfoobar <sniper@php.net>
Thu, 11 Aug 2005 23:45:13 +0000 (23:45 +0000)
ext/pdo_mysql/tests/bug_33689.phpt
ext/pdo_mysql/tests/common.phpt
ext/pdo_mysql/tests/config.inc [new file with mode: 0644]
ext/pdo_mysql/tests/show_tables.phpt

index 5d584a36f9f7fb7c1f18d448c137436553561ef2..6df65695648ae65407812a6259c1ae2c8dc4aa3f 100644 (file)
@@ -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
index 4351d9646ed160e7ae8dc16dcf66377c123b875f..8179454cf76d1370812a2f097717c581231a117b 100644 (file)
@@ -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 (file)
index 0000000..855f89b
--- /dev/null
@@ -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");
+}
index 8919b6b778c8823e3a646e5fb3b23bf94dc21e12..dc95d5f5f706d0527f0c02dee182a6465ca71d29 100644 (file)
@@ -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