sixd                                     Mon, 12 Mar 2012 18:08:34 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=324165

Log:
Test portability and coverage changes

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt
    U   php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt
    A   php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
    U   php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt
    U   php/php-src/branches/PHP_5_3/ext/oci8/tests/drcp_privileged.phpt
    U   php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bdouble.phpt
    U   php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bfloat.phpt
    A   php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt
    U   php/php-src/branches/PHP_5_4/ext/oci8/tests/bug43497_92.phpt
    U   php/php-src/branches/PHP_5_4/ext/oci8/tests/drcp_privileged.phpt
    U   php/php-src/trunk/ext/oci8/tests/array_bind_bdouble.phpt
    U   php/php-src/trunk/ext/oci8/tests/array_bind_bfloat.phpt
    A   php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt
    U   php/php-src/trunk/ext/oci8/tests/bug43497_92.phpt
    U   php/php-src/trunk/ext/oci8/tests/drcp_privileged.phpt

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Added: php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -0,0 +1,42 @@
+--TEST--
+bind RAW field with OCI_B_BIN
+--SKIPIF--
+<?php
+$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
+require(dirname(__FILE__).'/skipif.inc');
+?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$stmt = oci_parse($c, "create table phptestrawtable( id number(10), fileimage raw(1000))");
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)");
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
+$fileimage = substr($fileimage, 0, 300);
+
+oci_bind_by_name( $stmt, ":id", $i, -1);
+oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, OCI_B_BIN);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, "SELECT fileimage FROM phptestrawtable");
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, "drop table phptestrawtable");
+oci_execute($stmt);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+string(32) "88b274d7a257ac6f70435b83abd4e26e"
+int(300)
+Done


Property changes on: php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -5,8 +5,12 @@
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
-if (preg_match('/Unknown/', oci_client_version()) != 1) {
-    die("skip expected output only valid with Oracle 9gR2 clients");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
+$iv = preg_match('/Oracle .*Version => (9\.2)/', $phpinfo);
+if ($iv != 1) {
+    die ("skip tests a feature that works only with Oracle 9iR2 client");
 }
 ?>
 --FILE--

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/drcp_privileged.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -3,11 +3,14 @@
 --SKIPIF--
 <?php
 if (!extension_loaded('oci8')) die("skip no oci8 extension");
+require(dirname(__FILE__)."/details.inc");
 if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
-require(dirname(__FILE__)."/details.inc");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
 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 remote Oracle - unless an Oracle password file has been created");
+    die("skip this test is unlikely to work with a remote database - unless an Oracle password file has been created");
 }
 ?>
 --INI--

Modified: php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bdouble.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Modified: php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bfloat.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Added: php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -0,0 +1,42 @@
+--TEST--
+bind RAW field with OCI_B_BIN
+--SKIPIF--
+<?php
+$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
+require(dirname(__FILE__).'/skipif.inc');
+?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$stmt = oci_parse($c, "create table phptestrawtable( id number(10), fileimage raw(1000))");
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)");
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
+$fileimage = substr($fileimage, 0, 300);
+
+oci_bind_by_name( $stmt, ":id", $i, -1);
+oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, OCI_B_BIN);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, "SELECT fileimage FROM phptestrawtable");
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, "drop table phptestrawtable");
+oci_execute($stmt);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+string(32) "88b274d7a257ac6f70435b83abd4e26e"
+int(300)
+Done


Property changes on: php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/ext/oci8/tests/bug43497_92.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/oci8/tests/bug43497_92.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_4/ext/oci8/tests/bug43497_92.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -5,8 +5,12 @@
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
-if (preg_match('/Unknown/', oci_client_version()) != 1) {
-    die("skip expected output only valid with Oracle 9gR2 clients");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
+$iv = preg_match('/Oracle .*Version => (9\.2)/', $phpinfo);
+if ($iv != 1) {
+    die ("skip tests a feature that works only with Oracle 9iR2 client");
 }
 ?>
 --FILE--

Modified: php/php-src/branches/PHP_5_4/ext/oci8/tests/drcp_privileged.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_4/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -3,11 +3,14 @@
 --SKIPIF--
 <?php
 if (!extension_loaded('oci8')) die("skip no oci8 extension");
+require(dirname(__FILE__)."/details.inc");
 if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
-require(dirname(__FILE__)."/details.inc");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
 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 remote Oracle - unless an Oracle password file has been created");
+    die("skip this test is unlikely to work with a remote database - unless an Oracle password file has been created");
 }
 ?>
 --INI--

Modified: php/php-src/trunk/ext/oci8/tests/array_bind_bdouble.phpt
===================================================================
--- php/php-src/trunk/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/trunk/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Modified: php/php-src/trunk/ext/oci8/tests/array_bind_bfloat.phpt
===================================================================
--- php/php-src/trunk/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/trunk/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 <?php
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');
 ?>
 --FILE--
 <?php

Added: php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt
===================================================================
--- php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -0,0 +1,42 @@
+--TEST--
+bind RAW field with OCI_B_BIN
+--SKIPIF--
+<?php
+$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
+require(dirname(__FILE__).'/skipif.inc');
+?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$stmt = oci_parse($c, "create table phptestrawtable( id number(10), fileimage raw(1000))");
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)");
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
+$fileimage = substr($fileimage, 0, 300);
+
+oci_bind_by_name( $stmt, ":id", $i, -1);
+oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, OCI_B_BIN);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, "SELECT fileimage FROM phptestrawtable");
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, "drop table phptestrawtable");
+oci_execute($stmt);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+string(32) "88b274d7a257ac6f70435b83abd4e26e"
+int(300)
+Done


Property changes on: php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/ext/oci8/tests/bug43497_92.phpt
===================================================================
--- php/php-src/trunk/ext/oci8/tests/bug43497_92.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/trunk/ext/oci8/tests/bug43497_92.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -5,8 +5,12 @@
 $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
-if (preg_match('/Unknown/', oci_client_version()) != 1) {
-    die("skip expected output only valid with Oracle 9gR2 clients");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
+$iv = preg_match('/Oracle .*Version => (9\.2)/', $phpinfo);
+if ($iv != 1) {
+    die ("skip tests a feature that works only with Oracle 9iR2 client");
 }
 ?>
 --FILE--

Modified: php/php-src/trunk/ext/oci8/tests/drcp_privileged.phpt
===================================================================
--- php/php-src/trunk/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/trunk/ext/oci8/tests/drcp_privileged.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -3,11 +3,14 @@
 --SKIPIF--
 <?php
 if (!extension_loaded('oci8')) die("skip no oci8 extension");
+require(dirname(__FILE__)."/details.inc");
 if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
-require(dirname(__FILE__)."/details.inc");
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
 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 remote Oracle - unless an Oracle password file has been created");
+    die("skip this test is unlikely to work with a remote database - unless an Oracle password file has been created");
 }
 ?>
 --INI--
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to