Skip to content

Commit 605c60c

Browse files
authored
Skip oci8 tests when no database is available (#11820)
Most oci8 tests fail out-of-the-box because a typical host won't have an Oracle database instance available. Other database drivers like mysqli and pgsql address this problem with an include file, inserted into SKIPIF, that skips the test if no connection at all can be made. This commits adds such a file (skipifconnectfailure.inc) for oci8, and adds the corresponding SKIPIF to any tests that connect to a database. Closes GH-11804 * ext/oci8/tests/lob_aliases.phpt: drop unnecessary SKIPIF.
1 parent 82aa425 commit 605c60c

File tree

319 files changed

+627
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+627
-18
lines changed

ext/oci8/tests/array_bind_001.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name() and invalid values 1
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_002.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name() and invalid values 2
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_003.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and invalid values 3
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_004.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and invalid values 4
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_005.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and invalid values 5
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_006.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name(), SQLT_CHR and default max_length
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_007.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name() and invalid values 7
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_008.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and invalid values 8
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_009.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name() and invalid values 9
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_010.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name() and invalid values 8
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_011.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_012.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_013.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/array_bind_014.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and NUMBERs
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_bdouble.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unsupported type: oci_bind_array_by_name() and SQLT_BDOUBLE
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');

ext/oci8/tests/array_bind_bfloat.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unsupported type: oci_bind_array_by_name() and SQLT_BFLOAT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');

ext/oci8/tests/array_bind_date.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_ODT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_date1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_ODT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_float.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_FLT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_float1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_FLT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_int.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_INT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_int1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_INT
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_str.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_CHR
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_str1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ oci_bind_array_by_name() and SQLT_CHR
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/array_bind_uin.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unsupported type: oci_bind_array_by_name() and SQLT_UIN
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/b47243_1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bug #47243 (Crash on exit with ZTS mode)
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/b47243_2.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bug #47243 (Crash on exit with ZTS mode)
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/b47243_3.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bug #47243 (Crash on exit with ZTS mode)
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_boolean_1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Basic PL/SQL "BOOLEAN" (SQLT_BOL) bind test
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
require(__DIR__.'/connect.inc');
89
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);
910
if (!(isset($matches[0]) && $matches[1] >= 12)) {

ext/oci8/tests/bind_char_1.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
require(__DIR__."/connect.inc");
89
// The bind buffer size edge cases seem to change each DB version.
910
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);

ext/oci8/tests/bind_char_2.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
require(__DIR__."/connect.inc");
89
// The bind buffer size edge cases seem to change each DB version.
910
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);

ext/oci8/tests/bind_char_3.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
require(__DIR__."/connect.inc");
89
// The bind buffer size edge cases seem to change each DB version.
910
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);

ext/oci8/tests/bind_char_4.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
require(__DIR__."/connect.inc");
89
// The bind buffer size edge cases seem to change each DB version.
910
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);

ext/oci8/tests/bind_empty.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
binding empty values
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/bind_long.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bind LONG field
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_long_raw.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bind LONG RAW field
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_misccoltypes.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bind miscellaneous column types using default types
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_misccoltypes_errs.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Bind miscellaneous column types and generating errors
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/bind_number.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Bind with NUMBER column variants
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--INI--
610
precision = 14
711
--FILE--

ext/oci8/tests/bind_query.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Bind with various WHERE conditions
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/bind_raw.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bind RAW field
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_raw_2.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bind RAW field with OCI_B_BIN
44
oci8
55
--SKIPIF--
66
<?php
7+
require_once('skipifconnectfailure.inc');
78
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
89
require(__DIR__.'/skipif.inc');
910
?>

ext/oci8/tests/bind_rowid.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Test ROWID bind
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

ext/oci8/tests/bind_sqltafc.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Bind tests with SQLT_AFC
33
--EXTENSIONS--
44
oci8
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifconnectfailure.inc');
8+
?>
59
--FILE--
610
<?php
711

0 commit comments

Comments
 (0)