]> granicus.if.org Git - php/commitdiff
Improve test cross- DB version portability
authorChristopher Jones <sixd@php.net>
Tue, 16 Nov 2010 20:50:29 +0000 (20:50 +0000)
committerChristopher Jones <sixd@php.net>
Tue, 16 Nov 2010 20:50:29 +0000 (20:50 +0000)
ext/oci8/package.xml
ext/oci8/tests/connect_without_oracle_home.phpt
ext/oci8/tests/connect_without_oracle_home_11.phpt [new file with mode: 0644]
ext/oci8/tests/connect_without_oracle_home_old.phpt
ext/oci8/tests/connect_without_oracle_home_old_11.phpt [new file with mode: 0644]

index a56c010129b795bfaff53481ba963362c6d6b32a..7f87705f40c7ce75cfd8ff0634f9eab64365b3f6 100644 (file)
@@ -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" />
index 42cbde8b483af45b773529c0008c9e09ed601e68..e14fb93695eb4c4356d8b85dbcc4e87e1086b065 100644 (file)
@@ -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 (file)
index 0000000..be99a8b
--- /dev/null
@@ -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===
index 82d8ae451bc704e669fce1b179085c7c85da5ac4..602d55ff8fb4f7b471ba1a5c9338d99e8d116de0 100644 (file)
@@ -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 (file)
index 0000000..9bb42e7
--- /dev/null
@@ -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===