]> granicus.if.org Git - php/commitdiff
Tests will be skipped if a tester does not explicitly specify the
authorMarc Boeren <mboeren@php.net>
Mon, 7 Oct 2002 09:27:02 +0000 (09:27 +0000)
committerMarc Boeren <mboeren@php.net>
Mon, 7 Oct 2002 09:27:02 +0000 (09:27 +0000)
test-database setup in dbx_test.p.

ext/dbx/tests/003.phpt
ext/dbx/tests/004.phpt
ext/dbx/tests/005.phpt
ext/dbx/tests/006.phpt
ext/dbx/tests/007.phpt
ext/dbx/tests/008.phpt
ext/dbx/tests/dbx_test.p

index 03eec20ddf46363d17128817abb4e6e5c83c9534..fd0463f04e5c11f1b9b44c46257bd949c27953bb 100644 (file)
@@ -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";
index 80baa533743c3b83ea54e13356dfcb494126cc24..54b6887a7f21df33740defc68dae3628bd36e057 100644 (file)
@@ -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)) {
index 447fb3625ce84d02c0b136636fd9f39d63b64e08..993d9a9adabbeda1e06498ecbaab6c1ebad130df 100644 (file)
@@ -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";
index b4f29b51f829525d84fa87486af02e0099395250..31db8383193cc453a5b14b8eb139a2bf89865caa 100644 (file)
@@ -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");
index bfc8baa505ff24f86355d590de503a1d94307f5f..534a792b87ab6328901308b4aa48e58d7a5378e1 100644 (file)
@@ -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";
index ac3f76fe94f57065bf8dd9a34982174cf8b28e8f..8553671f20e2ed91911dc6096c436d7155dc4fd6 100644 (file)
@@ -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";
index 79418b20e0791a1f7c6d3e78f7fdbe4f8c744563..67f2546b24ac56e6635f9ad4113280cea9172eee 100644 (file)
@@ -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;