Skip to content

Commit

Permalink
OCI8: More test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbj committed Oct 17, 2013
1 parent 0d909f5 commit 89e93bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ext/oci8/tests/connect_without_oracle_home_old.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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===
15 changes: 14 additions & 1 deletion ext/oci8/tests/drcp_privileged.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 89e93bd

Please sign in to comment.