summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-09-21 18:40:56 +0000
committerMarcus Boerger <helly@php.net>2005-09-21 18:40:56 +0000
commita72a517e2f1e27ba48a408601d1e963adea1d3fe (patch)
tree7784a31cc113eff09a5cb9dc68fe6c7ea5ddc122
parent09881626498d06e492aae9dafd864a9021995e33 (diff)
downloadphp-git-a72a517e2f1e27ba48a408601d1e963adea1d3fe.tar.gz
- Add ability to execute .php generated from .phpt on failure without the
need to manually set the environment.
-rw-r--r--ext/pdo/tests/pdo_001.phpt1
-rw-r--r--ext/pdo/tests/pdo_002.phpt1
-rw-r--r--ext/pdo/tests/pdo_003.phpt1
-rw-r--r--ext/pdo/tests/pdo_004.phpt1
-rw-r--r--ext/pdo/tests/pdo_005.phpt1
-rw-r--r--ext/pdo/tests/pdo_006.phpt1
-rw-r--r--ext/pdo/tests/pdo_007.phpt1
-rw-r--r--ext/pdo/tests/pdo_008.phpt1
-rw-r--r--ext/pdo/tests/pdo_009.phpt1
-rw-r--r--ext/pdo/tests/pdo_010.phpt1
-rw-r--r--ext/pdo/tests/pdo_011.phpt1
-rw-r--r--ext/pdo/tests/pdo_012.phpt1
-rw-r--r--ext/pdo/tests/pdo_013.phpt1
-rw-r--r--ext/pdo/tests/pdo_014.phpt1
-rw-r--r--ext/pdo/tests/pdo_015.phpt1
-rw-r--r--ext/pdo/tests/pdo_016.phpt1
-rwxr-xr-xext/pdo/tests/pdo_016a.phpt1
-rw-r--r--ext/pdo/tests/pdo_017.phpt1
-rw-r--r--ext/pdo/tests/pdo_018.phpt1
-rw-r--r--ext/pdo/tests/pdo_019.phpt1
-rw-r--r--ext/pdo/tests/pdo_020.phpt1
-rw-r--r--ext/pdo/tests/pdo_021.phpt1
-rw-r--r--ext/pdo/tests/pdo_022.phpt1
-rw-r--r--ext/pdo/tests/pdo_023.phpt1
-rw-r--r--ext/pdo/tests/pdo_024.phpt1
-rw-r--r--ext/pdo/tests/pdo_025.phpt1
-rw-r--r--ext/pdo/tests/pdo_026.phpt1
-rw-r--r--ext/pdo/tests/pdo_027.phpt1
-rw-r--r--ext/pdo/tests/pdo_028.phpt1
-rw-r--r--ext/pdo/tests/pdo_test.inc15
-rw-r--r--ext/pdo/tests/pecl_bug_5217.phpt1
31 files changed, 45 insertions, 0 deletions
diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt
index e90d8ff162..0c03d016de 100644
--- a/ext/pdo/tests/pdo_001.phpt
+++ b/ext/pdo/tests/pdo_001.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_002.phpt b/ext/pdo/tests/pdo_002.phpt
index 4c4363ba4a..b83a874e29 100644
--- a/ext/pdo/tests/pdo_002.phpt
+++ b/ext/pdo/tests/pdo_002.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_003.phpt b/ext/pdo/tests/pdo_003.phpt
index b4d86dece1..81e314b56f 100644
--- a/ext/pdo/tests/pdo_003.phpt
+++ b/ext/pdo/tests/pdo_003.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_004.phpt b/ext/pdo/tests/pdo_004.phpt
index ab5af41e82..e8e4f43480 100644
--- a/ext/pdo/tests/pdo_004.phpt
+++ b/ext/pdo/tests/pdo_004.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_005.phpt b/ext/pdo/tests/pdo_005.phpt
index 3c107a0fa0..2f641dcd01 100644
--- a/ext/pdo/tests/pdo_005.phpt
+++ b/ext/pdo/tests/pdo_005.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_006.phpt b/ext/pdo/tests/pdo_006.phpt
index c8b92a5a8f..4c1f61b935 100644
--- a/ext/pdo/tests/pdo_006.phpt
+++ b/ext/pdo/tests/pdo_006.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_007.phpt b/ext/pdo/tests/pdo_007.phpt
index 89794a1d89..97dcf310f5 100644
--- a/ext/pdo/tests/pdo_007.phpt
+++ b/ext/pdo/tests/pdo_007.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_008.phpt b/ext/pdo/tests/pdo_008.phpt
index 628904db2f..680087855b 100644
--- a/ext/pdo/tests/pdo_008.phpt
+++ b/ext/pdo/tests/pdo_008.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_009.phpt b/ext/pdo/tests/pdo_009.phpt
index 48d9b57396..458497a649 100644
--- a/ext/pdo/tests/pdo_009.phpt
+++ b/ext/pdo/tests/pdo_009.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_010.phpt b/ext/pdo/tests/pdo_010.phpt
index 8b51238ab4..7d886bbeea 100644
--- a/ext/pdo/tests/pdo_010.phpt
+++ b/ext/pdo/tests/pdo_010.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_011.phpt b/ext/pdo/tests/pdo_011.phpt
index 40e478455b..87d99b0956 100644
--- a/ext/pdo/tests/pdo_011.phpt
+++ b/ext/pdo/tests/pdo_011.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_012.phpt b/ext/pdo/tests/pdo_012.phpt
index fe904dc146..a344afaf73 100644
--- a/ext/pdo/tests/pdo_012.phpt
+++ b/ext/pdo/tests/pdo_012.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_013.phpt b/ext/pdo/tests/pdo_013.phpt
index 6ce1fa0e13..28ac0dc1f7 100644
--- a/ext/pdo/tests/pdo_013.phpt
+++ b/ext/pdo/tests/pdo_013.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_014.phpt b/ext/pdo/tests/pdo_014.phpt
index 2f18366f48..9dbe68e06d 100644
--- a/ext/pdo/tests/pdo_014.phpt
+++ b/ext/pdo/tests/pdo_014.phpt
@@ -12,6 +12,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_015.phpt b/ext/pdo/tests/pdo_015.phpt
index 6e90fdcb97..089b814adc 100644
--- a/ext/pdo/tests/pdo_015.phpt
+++ b/ext/pdo/tests/pdo_015.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_016.phpt b/ext/pdo/tests/pdo_016.phpt
index fa6715f06b..30346c7932 100644
--- a/ext/pdo/tests/pdo_016.phpt
+++ b/ext/pdo/tests/pdo_016.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_016a.phpt b/ext/pdo/tests/pdo_016a.phpt
index 2ec1f22903..964dd08e0e 100755
--- a/ext/pdo/tests/pdo_016a.phpt
+++ b/ext/pdo/tests/pdo_016a.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt
index bb35bd8aca..5594ae9787 100644
--- a/ext/pdo/tests/pdo_017.phpt
+++ b/ext/pdo/tests/pdo_017.phpt
@@ -23,6 +23,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt
index 1c57852a26..3264893a43 100644
--- a/ext/pdo/tests/pdo_018.phpt
+++ b/ext/pdo/tests/pdo_018.phpt
@@ -11,6 +11,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_019.phpt b/ext/pdo/tests/pdo_019.phpt
index 8ca3b67f0e..383234df10 100644
--- a/ext/pdo/tests/pdo_019.phpt
+++ b/ext/pdo/tests/pdo_019.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_020.phpt b/ext/pdo/tests/pdo_020.phpt
index 5e6c68fcc8..a4396e6e2f 100644
--- a/ext/pdo/tests/pdo_020.phpt
+++ b/ext/pdo/tests/pdo_020.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt
index c1688c092b..1728000286 100644
--- a/ext/pdo/tests/pdo_021.phpt
+++ b/ext/pdo/tests/pdo_021.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_022.phpt b/ext/pdo/tests/pdo_022.phpt
index 4a97f0b7f8..12f79fef60 100644
--- a/ext/pdo/tests/pdo_022.phpt
+++ b/ext/pdo/tests/pdo_022.phpt
@@ -20,6 +20,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt
index 996fa7c645..25940f5f4c 100644
--- a/ext/pdo/tests/pdo_023.phpt
+++ b/ext/pdo/tests/pdo_023.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
class PDOStatementX extends PDOStatement
diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt
index e16303370d..a910996c2f 100644
--- a/ext/pdo/tests/pdo_024.phpt
+++ b/ext/pdo/tests/pdo_024.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_025.phpt b/ext/pdo/tests/pdo_025.phpt
index d65c93356d..2f51bd2f89 100644
--- a/ext/pdo/tests/pdo_025.phpt
+++ b/ext/pdo/tests/pdo_025.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt
index f61f16894e..c7d5debd02 100644
--- a/ext/pdo/tests/pdo_026.phpt
+++ b/ext/pdo/tests/pdo_026.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$data = array(
diff --git a/ext/pdo/tests/pdo_027.phpt b/ext/pdo/tests/pdo_027.phpt
index 226b4670aa..492b6e0fcd 100644
--- a/ext/pdo/tests/pdo_027.phpt
+++ b/ext/pdo/tests/pdo_027.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_028.phpt b/ext/pdo/tests/pdo_028.phpt
index aaf0f56c41..7d04dd96ed 100644
--- a/ext/pdo/tests/pdo_028.phpt
+++ b/ext/pdo/tests/pdo_028.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc
index 79df2baa29..94fa9fbbfa 100644
--- a/ext/pdo/tests/pdo_test.inc
+++ b/ext/pdo/tests/pdo_test.inc
@@ -1,6 +1,21 @@
<?php
# PDO test framework utilities
+if (getenv('PDOTEST_DSN') === false) {
+ $common = '';
+ $append = false;
+ foreach(file(dirname($_SERVER['PHP_SELF']).'/common.phpt') as $line) {
+ if ($append) {
+ $common .= $line;
+ } elseif (trim($line) == '--REDIRECTTEST--') {
+ $append = true;
+ }
+ }
+ if (ini_get('magic_quotes_runtime')) $common = stripslashes($common);
+ $conf = eval($common);
+ foreach($conf['ENV'] as $n=>$v) putenv("$n=$v");
+}
+
class PDOTest {
// create an instance of the PDO driver, based on
// the current environment
diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt
index 75df91956f..4b1170645e 100644
--- a/ext/pdo/tests/pecl_bug_5217.phpt
+++ b/ext/pdo/tests/pecl_bug_5217.phpt
@@ -10,6 +10,7 @@ PDOTest::skip();
?>
--FILE--
<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();
try {