summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/dbx/tests/003.phpt10
-rw-r--r--ext/dbx/tests/004.phpt10
-rw-r--r--ext/dbx/tests/005.phpt10
-rw-r--r--ext/dbx/tests/006.phpt10
-rw-r--r--ext/dbx/tests/007.phpt10
-rw-r--r--ext/dbx/tests/008.phpt10
-rw-r--r--ext/dbx/tests/dbx_test.p5
7 files changed, 52 insertions, 13 deletions
diff --git a/ext/dbx/tests/003.phpt b/ext/dbx/tests/003.phpt
index 03eec20ddf..fd0463f04e 100644
--- a/ext/dbx/tests/003.phpt
+++ b/ext/dbx/tests/003.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_connect
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
$nonexisting_database="nonexisting_database";
$nonexisting_username="nonexisting_username";
$nonexisting_password="nonexisting_password";
diff --git a/ext/dbx/tests/004.phpt b/ext/dbx/tests/004.phpt
index 80baa53374..54b6887a7f 100644
--- a/ext/dbx/tests/004.phpt
+++ b/ext/dbx/tests/004.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_close
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
$dlo = dbx_connect($module, $host, $database, $username, $password);
if ($dlo!=0) {
if (dbx_close($dlo)) {
diff --git a/ext/dbx/tests/005.phpt b/ext/dbx/tests/005.phpt
index 447fb3625c..993d9a9ada 100644
--- a/ext/dbx/tests/005.phpt
+++ b/ext/dbx/tests/005.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_query
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
$sql_statement = "select * from tbl order by id";
$invalid_sql_statement = "invalid select * from tbl";
$sql_select_statement = "select * from tbl where id=999999 and parentid=999999";
diff --git a/ext/dbx/tests/006.phpt b/ext/dbx/tests/006.phpt
index b4f29b51f8..31db838319 100644
--- a/ext/dbx/tests/006.phpt
+++ b/ext/dbx/tests/006.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_error
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
if ($module==DBX_ODBC) {
// ODBC module doesn't have an error-message-function (yet?)
print('query generated an error: dbx_error works ok'."\n");
diff --git a/ext/dbx/tests/007.phpt b/ext/dbx/tests/007.phpt
index bfc8baa505..534a792b87 100644
--- a/ext/dbx/tests/007.phpt
+++ b/ext/dbx/tests/007.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_sort
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
$sql_statement = "select id, description from tbl where parentid=1 order by id";
$compare_function = "cmp";
$invalid_compare_function = "invalid_cmp";
diff --git a/ext/dbx/tests/008.phpt b/ext/dbx/tests/008.phpt
index ac3f76fe94..8553671f20 100644
--- a/ext/dbx/tests/008.phpt
+++ b/ext/dbx/tests/008.phpt
@@ -1,12 +1,18 @@
--TEST--
dbx_compare
--SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
+<?php
+ if (!extension_loaded("dbx")) print("skip");
+ else {
+ include_once("dbx_test.p");
+ if ($connection===NULL) print("skip");
+ }
+?>
--POST--
--GET--
--FILE--
<?php
-include_once("ext/dbx/tests/dbx_test.p");
+include_once("dbx_test.p");
$sql_statement = "select id, description from tbl where parentid=1 order by id";
$compare_function_1 = "cmp_description_id";
$compare_function_2 = "cmp_description_desc_id";
diff --git a/ext/dbx/tests/dbx_test.p b/ext/dbx/tests/dbx_test.p
index 79418b20e0..67f2546b24 100644
--- a/ext/dbx/tests/dbx_test.p
+++ b/ext/dbx/tests/dbx_test.p
@@ -1,5 +1,8 @@
<?php
-$connection = DBX_SYBASECT;
+// set the $connection to match your test-database setup
+// (possibly change the rest of the settings too)
+// e.g. $connection = DBX_MYSQL;
+$connection = NULL;
switch ($connection) {
case DBX_MYSQL:
$module=DBX_MYSQL;