diff options
author | Wez Furlong <wez@php.net> | 2005-07-07 15:15:01 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2005-07-07 15:15:01 +0000 |
commit | 3c5b9a6e6a1cb7462c5e2ffec23bea34f29a18dd (patch) | |
tree | ccc8c9e1c91fa315716690e01ad51ed27aeeab4e /ext/pdo | |
parent | 86028ad122a49adfa830bc3675746c83d55d8753 (diff) | |
download | php-git-3c5b9a6e6a1cb7462c5e2ffec23bea34f29a18dd.tar.gz |
skip if we can't connect (include reason in skip output)
Diffstat (limited to 'ext/pdo')
27 files changed, 127 insertions, 26 deletions
diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt index e2f049218e..b1325be8d3 100644 --- a/ext/pdo/tests/pdo_001.phpt +++ b/ext/pdo/tests/pdo_001.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_ASSOC --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_002.phpt b/ext/pdo/tests/pdo_002.phpt index 88f2473d90..ac3355a7fe 100644 --- a/ext/pdo/tests/pdo_002.phpt +++ b/ext/pdo/tests/pdo_002.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_NUM --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_003.phpt b/ext/pdo/tests/pdo_003.phpt index 56e3f2f0a0..50c1749970 100644 --- a/ext/pdo/tests/pdo_003.phpt +++ b/ext/pdo/tests/pdo_003.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_BOTH --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_004.phpt b/ext/pdo/tests/pdo_004.phpt index ee7c065967..c8fd699440 100644 --- a/ext/pdo/tests/pdo_004.phpt +++ b/ext/pdo/tests/pdo_004.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_OBJ --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_005.phpt b/ext/pdo/tests/pdo_005.phpt index 71a2c32567..8eb292ac7f 100644 --- a/ext/pdo/tests/pdo_005.phpt +++ b/ext/pdo/tests/pdo_005.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_CLASS --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_006.phpt b/ext/pdo/tests/pdo_006.phpt index 06b16d0fb4..68fea037d7 100644 --- a/ext/pdo/tests/pdo_006.phpt +++ b/ext/pdo/tests/pdo_006.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_GROUP --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_007.phpt b/ext/pdo/tests/pdo_007.phpt index a8c873447f..7fbd0f5ccf 100644 --- a/ext/pdo/tests/pdo_007.phpt +++ b/ext/pdo/tests/pdo_007.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_UNIQUE --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_008.phpt b/ext/pdo/tests/pdo_008.phpt index 2528f790aa..c551b541ea 100644 --- a/ext/pdo/tests/pdo_008.phpt +++ b/ext/pdo/tests/pdo_008.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_UNIQUE conflict --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_009.phpt b/ext/pdo/tests/pdo_009.phpt index ded40c8be9..87890dcada 100644 --- a/ext/pdo/tests/pdo_009.phpt +++ b/ext/pdo/tests/pdo_009.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_CLASSTYPE --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_010.phpt b/ext/pdo/tests/pdo_010.phpt index 9e8cecb576..59e4e5666e 100644 --- a/ext/pdo/tests/pdo_010.phpt +++ b/ext/pdo/tests/pdo_010.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_CLASSTYPE and GROUP/UNIQUE --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_011.phpt b/ext/pdo/tests/pdo_011.phpt index 145772c6b5..6fa76ce980 100644 --- a/ext/pdo/tests/pdo_011.phpt +++ b/ext/pdo/tests/pdo_011.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_FUNC and statement overloading --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_012.phpt b/ext/pdo/tests/pdo_012.phpt index b052c9cf05..e3b5206231 100644 --- a/ext/pdo/tests/pdo_012.phpt +++ b/ext/pdo/tests/pdo_012.phpt @@ -3,7 +3,11 @@ PDO Common: PDOStatement::setFetchMode --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_013.phpt b/ext/pdo/tests/pdo_013.phpt index eb420e69bc..db654b0f0f 100644 --- a/ext/pdo/tests/pdo_013.phpt +++ b/ext/pdo/tests/pdo_013.phpt @@ -3,7 +3,11 @@ PDO Common: PDOStatement iterator --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_014.phpt b/ext/pdo/tests/pdo_014.phpt index 8c4e66fa6a..40ac8e877c 100644 --- a/ext/pdo/tests/pdo_014.phpt +++ b/ext/pdo/tests/pdo_014.phpt @@ -3,9 +3,12 @@ PDO Common: PDOStatement SPL iterator --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; if (!extension_loaded('SPL')) print 'skip SPL not available'; if (!class_exists('IteratorIterator')) print 'skip IteratorIterator class not present'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_015.phpt b/ext/pdo/tests/pdo_015.phpt index 4491f2baec..29baedfa49 100644 --- a/ext/pdo/tests/pdo_015.phpt +++ b/ext/pdo/tests/pdo_015.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_COLUMN --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_016.phpt b/ext/pdo/tests/pdo_016.phpt index cfa76df669..8727275dea 100644 --- a/ext/pdo/tests/pdo_016.phpt +++ b/ext/pdo/tests/pdo_016.phpt @@ -3,7 +3,11 @@ PDO Common: PDO_FETCH_BOUND --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?> +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> --FILE-- <?php require getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt index f0165fd342..554bce901e 100644 --- a/ext/pdo/tests/pdo_017.phpt +++ b/ext/pdo/tests/pdo_017.phpt @@ -3,7 +3,10 @@ PDO Common: transactions --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); /* TODO: $db = PDOTest::factory(); try { diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index 6ed6295ee2..19ef142128 100644 --- a/ext/pdo/tests/pdo_018.phpt +++ b/ext/pdo/tests/pdo_018.phpt @@ -3,8 +3,11 @@ PDO Common: serializing --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; if (!interface_exists('Serializable')) print 'skip no Serializable interface'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_019.phpt b/ext/pdo/tests/pdo_019.phpt index 1b331f982d..047b6e8495 100644 --- a/ext/pdo/tests/pdo_019.phpt +++ b/ext/pdo/tests/pdo_019.phpt @@ -3,7 +3,10 @@ PDO Common: fetch() and while() --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_020.phpt b/ext/pdo/tests/pdo_020.phpt index 8bce047bb2..72474cb85b 100644 --- a/ext/pdo/tests/pdo_020.phpt +++ b/ext/pdo/tests/pdo_020.phpt @@ -3,7 +3,10 @@ PDO Common: PDOStatement::columnCount --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt index 8300737582..7d05ea4873 100644 --- a/ext/pdo/tests/pdo_021.phpt +++ b/ext/pdo/tests/pdo_021.phpt @@ -3,7 +3,10 @@ PDO Common: PDOStatement::execute with parameters --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_022.phpt b/ext/pdo/tests/pdo_022.phpt index 2eb1fe73ae..7567a3ce4b 100644 --- a/ext/pdo/tests/pdo_022.phpt +++ b/ext/pdo/tests/pdo_022.phpt @@ -4,7 +4,10 @@ PDO Common: PDOStatement::getColumnMeta <?php # vim:ft=php die('skip this feature is not yet finalized, no test makes sense'); if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); /* * Note well: meta information is a nightmare to handle portably. * it's not really PDOs job. diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt index 4cc4437979..b1509e5f19 100644 --- a/ext/pdo/tests/pdo_023.phpt +++ b/ext/pdo/tests/pdo_023.phpt @@ -3,7 +3,10 @@ PDO Common: extending PDO --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt index 368722f2bb..ea0c813036 100644 --- a/ext/pdo/tests/pdo_024.phpt +++ b/ext/pdo/tests/pdo_024.phpt @@ -3,7 +3,10 @@ PDO Common: assert that bindParam does not modify parameter --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_025.phpt b/ext/pdo/tests/pdo_025.phpt index b41c62ffc7..1e74bab363 100644 --- a/ext/pdo/tests/pdo_025.phpt +++ b/ext/pdo/tests/pdo_025.phpt @@ -3,7 +3,10 @@ PDO Common: PDO_FETCH_INTO --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt index 0c8ba68871..835e82e7eb 100644 --- a/ext/pdo/tests/pdo_026.phpt +++ b/ext/pdo/tests/pdo_026.phpt @@ -3,7 +3,10 @@ PDO Common: extending PDO (2) --SKIPIF-- <?php # vim:ft=php if (!extension_loaded('pdo')) print 'skip'; -if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) print 'skip no driver'; +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); ?> --FILE-- <?php diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc index b4e68da4a8..2f1fb3438d 100644 --- a/ext/pdo/tests/pdo_test.inc +++ b/ext/pdo/tests/pdo_test.inc @@ -31,6 +31,14 @@ class PDOTest { $db->setAttribute(PDO_ATTR_CASE, PDO_CASE_LOWER); return $db; } + + static function skip() { + try { + $db = PDOTest::factory(); + } catch (PDOException $e) { + echo "skip " . $e->getMessage(); + } + } } |