summaryrefslogtreecommitdiff
path: root/ext/oci8/tests/password_old.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/tests/password_old.phpt')
-rw-r--r--ext/oci8/tests/password_old.phpt24
1 files changed, 17 insertions, 7 deletions
diff --git a/ext/oci8/tests/password_old.phpt b/ext/oci8/tests/password_old.phpt
index fdbb1f9e89..2e186528e3 100644
--- a/ext/oci8/tests/password_old.phpt
+++ b/ext/oci8/tests/password_old.phpt
@@ -3,18 +3,28 @@ ocipasswordchange()
--SKIPIF--
<?php
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on thes
-require(dirname(__FILE__).'/skipif.inc');
+require(dirname(__FILE__).'/connect.inc');
if (empty($dbase)) die ("skip requires database connection string be set");
if ($test_drcp) die("skip password change not supported in DRCP Mode");
-// This test is known to fail with Oracle 10.2.0.4 client libraries
-// connecting to Oracle Database 11 (Oracle bug 6277160, fixed 10.2.0.5)
-if (preg_match('/Release (11|12)\./', oci_server_version($c), $matches) === 1 &&
- preg_match('/^10\.2\.0\.[1234]/', oci_client_version()) === 1) {
- die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)");
+preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv);
+if (isset($matches_sv[1]) && $matches_sv[1] >= 11) {
+ preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches);
+ if (isset($matches[0]) && $matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] < 5) {
+ die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)");
+ }
}
-
+// This test in Oracle 12c needs a non-CDB or the root container
+if (isset($matches_sv[1]) && $matches_sv[1] >= 12) {
+ $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual");
+ $r = @oci_execute($s);
+ if (!$r)
+ die('skip could not identify container type');
+ $r = oci_fetch_array($s);
+ if ($r['DBTYPE'] !== 'CDB$ROOT')
+ die('skip cannot run test using a PDB');
+}
?>
--FILE--
<?php