OCI8: More test updates

This commit is contained in:
Christopher Jones 2013-10-16 22:33:34 -07:00
parent 0d909f5bfc
commit 89e93bd2a2
2 changed files with 17 additions and 1 deletions

View 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===

View 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