]> granicus.if.org Git - php/commitdiff
Improve test portability
authorChristopher Jones <sixd@php.net>
Wed, 10 Nov 2010 18:46:05 +0000 (18:46 +0000)
committerChristopher Jones <sixd@php.net>
Wed, 10 Nov 2010 18:46:05 +0000 (18:46 +0000)
ext/oci8/tests/bind_char_1.phpt
ext/oci8/tests/bind_char_2.phpt
ext/oci8/tests/bind_char_3.phpt
ext/oci8/tests/bind_char_4.phpt
ext/oci8/tests/bug27303_1.phpt
ext/oci8/tests/bug27303_2.phpt
ext/oci8/tests/bug27303_4.phpt
ext/oci8/tests/debug.phpt
ext/oci8/tests/oci8safemode.phpt

index 71cccbfc50ad583573e22a9811b6e81c6e28d7f2..24ab1fc8251c1fdc2aa18398b1f3a7092d61748f 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff on the undefined cases with a 32bit 11.2.0.1 DB
-
 require(dirname(__FILE__).'/connect.inc');
 
 // Initialization
index 6c7dbafcc5414e681a76b1f28f696360a89d7a6e..fa2e547dbe30033dfc706296eb3fb5aa5f7e4f56 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff on the undefined cases with a 32bit 11.2.0.1 DB
-
 require(dirname(__FILE__).'/connect.inc');
 
 // Initialization
index 8d4e95f6bf677e31f7241ec7a6d862936e9ccb53..052981aceae21a81014139b5d8bacea695663e79 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff on the undefined cases with a 32bit 11.2.0.1 DB
-
 require(dirname(__FILE__).'/connect.inc');
 
 // Initialization
index 40221b266f52bdd89a6fce8601dd9a315a7330c8..fd38d902cc84b01a77e1a330945040c950a2833e 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff on the undefined cases with a 32bit 11.2.0.1 DB
-
 // Same test as bind_char_3 but the PL/SQL function uses VARCHAR2 instead of CHAR
 
 require(dirname(__FILE__).'/connect.inc');
index 82c2d6f506953d8f3160405e0ad09f83a1ccbbf4..6d491966a7ab9aee48d07d296f6a6779231bcb7c 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 19gR2 or 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff with a 32bit 11.2.0.1 DB
-
 require dirname(__FILE__).'/connect.inc';
        
 $create_st = array();
index 44b9ce6c612cb7ce968573b10cb6c2c7b6247bb3..3d0c0877036b920c631580d383e7e8fca35b4078 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 or 11gR2 database");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff with a 32bit 11.2.0.1 DB
-
 require dirname(__FILE__).'/connect.inc';
        
 $create_st = array();
index 3c35c65b778240b734fa20393790039b52445572..20dec54dacf889728aa684ad2ee945d5ad606c0d 100644 (file)
@@ -8,14 +8,19 @@ $sv = oci_server_version($c);
 $sv = preg_match('/Release 1[01]\.2\./', $sv, $matches);
 if ($sv !== 1) {
        die ("skip expected output only valid when using Oracle 10gR2 or 11gR2 databases");
+} else {
+    ob_start();
+    phpinfo(INFO_MODULES);
+    $phpinfo = ob_get_clean();
+    $iv = preg_match('/Oracle .*Version => 1[1]\./', $phpinfo);
+    if ($iv != 1) {
+        die ("skip test expected to work only with Oracle 11g or greater version of client");
+    }
 }
 ?>
 --FILE--
 <?php
 
-// Note: expected output is valid for 32bit clients to 32bit 10gR2 XE or 11.2.0.1 64bit DBs.
-// It will diff with a 32bit 11.2.0.1 DB
-
 require dirname(__FILE__).'/connect.inc';
        
 $create_st = array();
index 49e3d4cfd1fb0f255ff604897c59a629d6c931f7..fe96e6e87ec44442c26ed8b41b29f2d19ef89969 100644 (file)
@@ -1,16 +1,7 @@
 --TEST--
 oci_internal_debug()
 --SKIPIF--
-<?php 
-if (!extension_loaded('oci8')) die("skip no oci8 extension"); 
-ob_start();
-phpinfo(INFO_MODULES);
-$phpinfo = ob_get_clean();
-$iv = preg_match('/Oracle .*Version => (11\.2|12\.)/', $phpinfo);
-if ($iv !== 1) {
-       die ("skip expected output only valid when using Oracle 11gR2+ client libraries");
-}
-?>
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
 --FILE--
 <?php
 
@@ -27,45 +18,8 @@ else {
        
 echo "Done\n";
 
+oci_internal_debug(false);
+
 ?>
---EXPECTF--
-OCI8 DEBUG: OCINlsEnvironmentVariableGet at (%s:%d) 
-OCI8 DEBUG L1: Got NO cached connection at (%s:%d) 
-OCI8 DEBUG: OCIEnvNlsCreate at (%s:%d) 
-OCI8 DEBUG: OCIHandleAlloc at (%s:%d) 
-OCI8 DEBUG: OCIHandleAlloc at (%s:%d) 
-OCI8 DEBUG: OCIHandleAlloc at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG: OCISessionPoolCreate at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG L1: create_spool: (%s:%d) 
-OCI8 DEBUG L1: using shared pool: (%s:%d) 
-OCI8 DEBUG: OCIHandleAlloc at (%s:%d) 
-OCI8 DEBUG: OCIHandleAlloc at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG: OCIAttrGet at (%s:%d) 
-OCI8 DEBUG: OCIAttrGet at (%s:%d) 
-OCI8 DEBUG L1: (numopen=0)(numbusy=0) at (%s:%d) 
-OCI8 DEBUG: OCISessionGet at (%s:%d) 
-OCI8 DEBUG: OCIAttrGet at (%s:%d) 
-OCI8 DEBUG: OCIAttrGet at (%s:%d) 
-OCI8 DEBUG: OCIContextGetValue at (%s:%d) 
-OCI8 DEBUG: OCIContextGetValue at (%s:%d) 
-OCI8 DEBUG: OCIMemoryAlloc at (%s:%d) 
-OCI8 DEBUG: OCIContextSetValue at (%s:%d) 
-OCI8 DEBUG: OCIAttrSet at (%s:%d) 
-OCI8 DEBUG L1: New Non-Persistent Connection address: (%s) at (%s:%d) 
-OCI8 DEBUG L1: num_persistent=(%s:%d) 
-OCI8 DEBUG: OCISessionRelease at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-Done
-OCI8 DEBUG: OCISessionPoolDestroy at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d) 
-OCI8 DEBUG: OCIHandleFree at (%s:%d)
+--EXPECTREGEX--
+^OCI8 DEBUG: .*Done$
index 703393cc4e006876e601f63669370b290b1b3b92..02e180e654b98a7c544d5528cc881562831afd9e 100644 (file)
@@ -15,7 +15,7 @@ $r = oci_password_change($c, "hr", "hrpwd", "hrpwd");
 echo "Done\n";
 ?>
 --EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
+%s: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
 
 Warning: oci_connect(): Privileged connect is disabled in Safe Mode in %s on line %d