Skip to content

Commit 19c0803

Browse files
committed
Test portability and coverage changes
1 parent 9c886ea commit 19c0803

File tree

5 files changed

+55
-4
lines changed

5 files changed

+55
-4
lines changed

ext/oci8/tests/array_bind_bdouble.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unsupported type: oci_bind_array_by_name() and SQLT_BDOUBLE
44
<?php
55
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
66
require(dirname(__FILE__).'/skipif.inc');
7+
if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');
78
?>
89
--FILE--
910
<?php

ext/oci8/tests/array_bind_bfloat.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unsupported type: oci_bind_array_by_name() and SQLT_BFLOAT
44
<?php
55
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
66
require(dirname(__FILE__).'/skipif.inc');
7+
if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');
78
?>
89
--FILE--
910
<?php

ext/oci8/tests/bind_raw_2.phpt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--TEST--
2+
bind RAW field with OCI_B_BIN
3+
--SKIPIF--
4+
<?php
5+
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
6+
require(dirname(__FILE__).'/skipif.inc');
7+
?>
8+
--FILE--
9+
<?php
10+
11+
require dirname(__FILE__)."/connect.inc";
12+
13+
$stmt = oci_parse($c, "create table phptestrawtable( id number(10), fileimage raw(1000))");
14+
oci_execute($stmt);
15+
16+
$stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)");
17+
$i=1;
18+
$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
19+
$fileimage = substr($fileimage, 0, 300);
20+
21+
oci_bind_by_name( $stmt, ":id", $i, -1);
22+
oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, OCI_B_BIN);
23+
oci_execute($stmt, OCI_DEFAULT);
24+
oci_commit($c);
25+
26+
$stmt = oci_parse($c, "SELECT fileimage FROM phptestrawtable");
27+
oci_execute($stmt);
28+
29+
$row = oci_fetch_row($stmt);
30+
var_dump(md5($row[0]));
31+
var_dump(strlen($row[0]));
32+
33+
$stmt = oci_parse($c, "drop table phptestrawtable");
34+
oci_execute($stmt);
35+
36+
echo "Done\n";
37+
38+
?>
39+
--EXPECT--
40+
string(32) "88b274d7a257ac6f70435b83abd4e26e"
41+
int(300)
42+
Done

ext/oci8/tests/bug43497_92.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ Bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory)
55
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
66
require(dirname(__FILE__).'/skipif.inc');
77
if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
8-
if (preg_match('/Unknown/', oci_client_version()) != 1) {
9-
die("skip expected output only valid with Oracle 9gR2 clients");
8+
ob_start();
9+
phpinfo(INFO_MODULES);
10+
$phpinfo = ob_get_clean();
11+
$iv = preg_match('/Oracle .*Version => (9\.2)/', $phpinfo);
12+
if ($iv != 1) {
13+
die ("skip tests a feature that works only with Oracle 9iR2 client");
1014
}
1115
?>
1216
--FILE--

ext/oci8/tests/drcp_privileged.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ DRCP: privileged connect
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('oci8')) die("skip no oci8 extension");
6-
if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
76
require(dirname(__FILE__)."/details.inc");
7+
if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
8+
ob_start();
9+
phpinfo(INFO_MODULES);
10+
$phpinfo = ob_get_clean();
811
if (preg_match('/Compile-time ORACLE_HOME/', $phpinfo) !== 1) {
912
// Assume building PHP with an ORACLE_HOME means the tested DB is on the same machine as PHP
10-
die("skip this test is unlikely to work with remote Oracle - unless an Oracle password file has been created");
13+
die("skip this test is unlikely to work with a remote database - unless an Oracle password file has been created");
1114
}
1215
?>
1316
--INI--

0 commit comments

Comments
 (0)