From 2bc233e856ce8a9af0b0f5c9d32697032e26a27d Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 16 Nov 2010 20:50:29 +0000 Subject: [PATCH] Improve test cross- DB version portability --- ext/oci8/package.xml | 2 + .../tests/connect_without_oracle_home.phpt | 4 ++ .../tests/connect_without_oracle_home_11.phpt | 41 +++++++++++++++++++ .../connect_without_oracle_home_old.phpt | 4 ++ .../connect_without_oracle_home_old_11.phpt | 41 +++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 ext/oci8/tests/connect_without_oracle_home_11.phpt create mode 100644 ext/oci8/tests/connect_without_oracle_home_old_11.phpt 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"> + + 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-- + (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-- + +===DONE=== + +--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-- + (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-- + +===DONE=== + +--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=== -- 2.40.0