diff options
-rw-r--r-- | ext/oci8/package.xml | 2 | ||||
-rw-r--r-- | ext/oci8/tests/connect_without_oracle_home.phpt | 4 | ||||
-rw-r--r-- | ext/oci8/tests/connect_without_oracle_home_11.phpt | 41 | ||||
-rw-r--r-- | ext/oci8/tests/connect_without_oracle_home_old.phpt | 4 | ||||
-rw-r--r-- | ext/oci8/tests/connect_without_oracle_home_old_11.phpt | 41 |
5 files changed, 92 insertions, 0 deletions
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index a56c010129..7f87705f40 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -183,6 +183,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> <file name="connect_scope_try5.phpt" role="test" /> <file name="connect_scope_try6.phpt" role="test" /> <file name="connect_with_charset_001.phpt" role="test" /> + <file name="connect_without_oracle_home_11.phpt" role="test" /> + <file name="connect_without_oracle_home_old_11.phpt" role="test" /> <file name="connect_without_oracle_home_old.phpt" role="test" /> <file name="connect_without_oracle_home.phpt" role="test" /> <file name="create_table.inc" role="test" /> diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt index 42cbde8b48..e14fb93695 100644 --- a/ext/oci8/tests/connect_without_oracle_home.phpt +++ b/ext/oci8/tests/connect_without_oracle_home.phpt @@ -10,6 +10,10 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } +$iv = preg_match('/Oracle .*Version => (10\.2)/', $phpinfo); +if ($iv != 1) { + die ("skip tests a feature that works only with Oracle 10gR2"); +} ?> --ENV-- ORACLE_HOME="" diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt new file mode 100644 index 0000000000..be99a8bd6e --- /dev/null +++ b/ext/oci8/tests/connect_without_oracle_home_11.phpt @@ -0,0 +1,41 @@ +--TEST-- +oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) +--SKIPIF-- +<?php +if (!extension_loaded('oci8')) die("skip no oci8 extension"); +ob_start(); +phpinfo(INFO_MODULES); +$phpinfo = ob_get_clean(); +$ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); +if ($ov != 1) { + die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); +} +$iv = preg_match('/Oracle .*Version => (11\.2|12)/', $phpinfo); +if ($iv != 1) { + die ("skip tests a feature that works only with Oracle 11gR2 or greater version of client"); +} +?> +--ENV-- +ORACLE_HOME="" +--FILE-- +<?php + +require dirname(__FILE__)."/details.inc"; + +if (!empty($dbase)) { + var_dump(oci_connect($user, $password, $dbase)); +} +else { + var_dump(oci_connect($user, $password)); +} + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +Warning: oci_connect(): 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: oci_connect(): Error while trying to retrieve text for error ORA-01804 + in %s on line %d +bool(false) +===DONE=== diff --git a/ext/oci8/tests/connect_without_oracle_home_old.phpt b/ext/oci8/tests/connect_without_oracle_home_old.phpt index 82d8ae451b..602d55ff8f 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old.phpt @@ -10,6 +10,10 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } +$iv = preg_match('/Oracle .*Version => (10\.2)/', $phpinfo); +if ($iv != 1) { + die ("skip tests a feature that works only with Oracle 10gR2"); +} ?> --ENV-- ORACLE_HOME="" diff --git a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt new file mode 100644 index 0000000000..9bb42e75a4 --- /dev/null +++ b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt @@ -0,0 +1,41 @@ +--TEST-- +ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults) +--SKIPIF-- +<?php +if (!extension_loaded('oci8')) die("skip no oci8 extension"); +ob_start(); +phpinfo(INFO_MODULES); +$phpinfo = ob_get_clean(); +$ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); +if ($ov !== 1) { + die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); +} +$iv = preg_match('/Oracle .*Version => (11\.2|12)/', $phpinfo); +if ($iv != 1) { + die ("skip tests a feature that works only with Oracle 11gR2 or greater version of client"); +} +?> +--ENV-- +ORACLE_HOME="" +--FILE-- +<?php + +require dirname(__FILE__)."/details.inc"; + +if (!empty($dbase)) { + var_dump(ocilogon($user, $password, $dbase)); +} +else { + var_dump(ocilogon($user, $password)); +} + +?> +===DONE=== +<?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(): Error while trying to retrieve text for error ORA-01804 + in %sconnect_without_oracle_home_old_11.php on line %d +bool(false) +===DONE=== |