]> granicus.if.org Git - php/commitdiff
OCI8: More test updates
authorChristopher Jones <sixd@php.net>
Thu, 17 Oct 2013 05:33:34 +0000 (22:33 -0700)
committerChristopher Jones <sixd@php.net>
Thu, 17 Oct 2013 05:33:34 +0000 (22:33 -0700)
ext/oci8/tests/connect_without_oracle_home_old.phpt
ext/oci8/tests/drcp_privileged.phpt

index 82d8ae451bc704e669fce1b179085c7c85da5ac4..d6d12b47ba338df8ecb234a303a79d7fd5b1ea7c 100644 (file)
@@ -30,5 +30,8 @@ else {
 <?php exit(0); ?>
 --EXPECTF--
 Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d
+
+Warning: ocilogon(): %s ORA-01804
+ in %s on line %d
 bool(false)
 ===DONE===
index da8702e3c920418b68cee2be2871916243f03401..3871341bc50cc938774a8cf4e3d30699ee1770a4 100644 (file)
@@ -3,7 +3,8 @@ DRCP: privileged connect
 --SKIPIF--
 <?php
 if (!extension_loaded('oci8')) die("skip no oci8 extension");
-require(dirname(__FILE__)."/details.inc");
+require(dirname(__FILE__)."/connect.inc");
+if (!$test_drcp) die("skip requires DRCP connection");
 if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
 ob_start();
 phpinfo(INFO_MODULES);
@@ -12,6 +13,18 @@ if (preg_match('/Compile-time ORACLE_HOME/', $phpinfo) !== 1) {
     // Assume building PHP with an ORACLE_HOME means the tested DB is on the same machine as PHP
     die("skip this test is unlikely to work with a remote database - unless an Oracle password file has been created");
 }
+
+preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv);
+// This test in Oracle 12c needs a non-CDB or the root container
+if (isset($matches_sv[0]) && $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');
+}
 ?>
 --INI--
 oci8.privileged_connect=1