Skip to content

Commit 8c3bf96

Browse files
committed
Small test tidy up
Make some test changes so the tests can be run with the CLI webserver
1 parent 8848778 commit 8c3bf96

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

ext/oci8/tests/details.inc

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,34 @@ if (file_exists(dirname(__FILE__)."/details_local.inc")) {
4545
* Used for creating/dropping schema objects used by a test
4646
*/
4747

48-
function oci8_test_sql_execute($c, $stmtarray)
49-
{
50-
foreach ($stmtarray as $stmt) {
51-
$s = oci_parse($c, $stmt);
52-
if (!$s) {
53-
$m = oci_error($c);
54-
echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
55-
}
56-
else {
57-
$r = @oci_execute($s);
58-
if (!$r) {
59-
$m = oci_error($s);
60-
if (!in_array($m['code'], array( // ignore expected errors
61-
942 // table or view does not exist
62-
, 1918 // user does not exist
63-
, 2024 // database link not found
64-
, 2289 // sequence does not exist
65-
, 4080 // trigger does not exist
66-
, 38802 // edition does not exist
67-
))) {
68-
echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
69-
}
70-
}
71-
}
72-
}
48+
if (!function_exists('oci8_test_sql_execute')) {
49+
function oci8_test_sql_execute($c, $stmtarray)
50+
{
51+
foreach ($stmtarray as $stmt) {
52+
$s = oci_parse($c, $stmt);
53+
if (!$s) {
54+
$m = oci_error($c);
55+
echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
56+
}
57+
else {
58+
$r = @oci_execute($s);
59+
if (!$r) {
60+
$m = oci_error($s);
61+
if (!in_array($m['code'], array( // ignore expected errors
62+
942 // table or view does not exist
63+
, 1918 // user does not exist
64+
, 2024 // database link not found
65+
, 2289 // sequence does not exist
66+
, 4080 // trigger does not exist
67+
, 38802 // edition does not exist
68+
))) {
69+
echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
70+
}
71+
}
72+
}
73+
}
74+
}
75+
7376
}
7477

7578
?>

ext/oci8/tests/xmltype_01.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Basic XMLType test
55
if (!extension_loaded("simplexml")) die("skip no simplexml extension");
66
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
77
require(dirname(__FILE__).'/skipif.inc');
8+
?>
89
--FILE--
910
<?php
1011

0 commit comments

Comments
 (0)