Skip to content

Commit 8f19ee9

Browse files
committed
Correct errors in tests and add a README.md file for the tests
1 parent 50d60b0 commit 8f19ee9

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

tests/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Test Configuration Requirements
2+
3+
Check the [details.inc](details.inc) file for the configuration details.
4+
5+
Set the following environment variables to provide credentials for the PHP tests:
6+
7+
`PHP_OCI8_TEST_USER` - the username of the database schema user to be used for testing.
8+
9+
`PHP_OCI8_TEST_PASS` - the password of the database schema user to be used for testing.
10+
11+
`PHP_OCI8_TEST_DB` - the connection string that points to your database's location.
12+
13+
`PHP_OCI8_TEST_DRCP` - for running DRCP tests. It should be set to ``true``
14+
to run DRCP tests. Otherwise, DRCP-specific tests are skipped.
15+
16+
# Running the tests
17+
18+
To run the tests, execute:
19+
```
20+
php <testname>
21+
22+
```

tests/lob_prefetch.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function get_clob_loc($c, $sql, $pfl) {
5858
while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) {
5959
$l[] = $row['CLOB']->load();
6060
$row['CLOB']->free();
61-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
61+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. clob length = " . strlen($l[0])); exit; }
6262
}
6363
return($l);
6464
}
@@ -71,7 +71,7 @@ function get_clob_inline($c, $sql, $pfl) {
7171
$l = [];
7272
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_LOBS)) != false) {
7373
$l[] = $row['CLOB'];
74-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
74+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. clob length = " . strlen($l[0])); exit; }
7575
}
7676
return($l);
7777
}
@@ -99,7 +99,7 @@ function get_blob_loc($c, $sql, $pfl) {
9999
while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) {
100100
$l[] = $row['BLOB']->load();
101101
$row['BLOB']->free();
102-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
102+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. blob length = " . strlen($l[0])); exit; }
103103
}
104104
return($l);
105105
}

tests/lob_prefetch_ini.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function get_clob_loc($c, $sql, $pfl) {
5959
while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) {
6060
$l[] = $row['CLOB']->load();
6161
$row['CLOB']->free();
62-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
62+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. clob length = " . strlen($l[0])); exit; }
6363
}
6464
return($l);
6565
}
@@ -72,7 +72,7 @@ function get_clob_inline($c, $sql, $pfl) {
7272
$l = [];
7373
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_LOBS)) != false) {
7474
$l[] = $row['CLOB'];
75-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
75+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. clob length = " . strlen($l[0])); exit; }
7676
}
7777
return($l);
7878
}
@@ -100,7 +100,7 @@ function get_blob_loc($c, $sql, $pfl) {
100100
while (($row = oci_fetch_array($stid, OCI_ASSOC)) != false) {
101101
$l[] = $row['BLOB']->load();
102102
$row['BLOB']->free();
103-
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure" . strlen($l)); exit; }
103+
if (strlen($l[0]) != LOBSIZE) { print("strlen(l) failure. blob length = " . strlen($l[0])); exit; }
104104
}
105105
return($l);
106106
}

0 commit comments

Comments
 (0)