tony2001 Wed Dec 27 09:48:05 2006 UTC
Added files:
/php-src/ext/oci8/tests function_aliases.phpt lob_aliases.phpt
Modified files:
/php-src/ext/oci8/tests details.inc num.phpt statement_type.phpt
statement_type_old.phpt
Log:
more test improvements by Chris Jones
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/details.inc?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/oci8/tests/details.inc
diff -u php-src/ext/oci8/tests/details.inc:1.1
php-src/ext/oci8/tests/details.inc:1.2
--- php-src/ext/oci8/tests/details.inc:1.1 Tue Dec 12 12:57:02 2006
+++ php-src/ext/oci8/tests/details.inc Wed Dec 27 09:48:05 2006
@@ -7,7 +7,7 @@
$user = "system";
$password = "system";
-$dbase = "oracle";
+$dbase = "HP";
/* Set this variable to TRUE if Oracle is installed @ localhost */
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/num.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/oci8/tests/num.phpt
diff -u php-src/ext/oci8/tests/num.phpt:1.3 php-src/ext/oci8/tests/num.phpt:1.4
--- php-src/ext/oci8/tests/num.phpt:1.3 Tue Dec 6 19:26:57 2005
+++ php-src/ext/oci8/tests/num.phpt Wed Dec 27 09:48:05 2006
@@ -8,32 +8,117 @@
require dirname(__FILE__)."/connect.inc";
require dirname(__FILE__).'/create_table.inc';
+echo "Test 1\n";
+var_dump(ocirowcount());
+var_dump(oci_num_rows());
+var_dump(ocinumcols());
+var_dump(oci_num_fields());
+
$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
if (!($s = oci_parse($c, $insert_sql))) {
- die("oci_parse(insert) failed!\n");
+ die("oci_parse(insert) failed!\n");
}
+echo "Test 2\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
for ($i = 0; $i<3; $i++) {
- if (!oci_execute($s)) {
- die("oci_execute(insert) failed!\n");
- }
+ if (!oci_execute($s)) {
+ die("oci_execute(insert) failed!\n");
+ }
}
+echo "Test 3\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
if (!oci_commit($c)) {
- die("oci_commit() failed!\n");
+ die("oci_commit() failed!\n");
}
+echo "Test 4\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// All rows
$select_sql = "SELECT * FROM ".$schema.$table_name."";
if (!($s = oci_parse($c, $select_sql))) {
- die("oci_parse(select) failed!\n");
+ die("oci_parse(select) failed!\n");
+}
+
+echo "Test 5a\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+if (!oci_execute($s)) {
+ die("oci_execute(select) failed!\n");
+}
+
+echo "Test 5b\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
+if (oci_fetch_all($s,$r) === false) {
+ die("oci_fetch_all(select) failed!\n");
+}
+
+echo "Test 5c\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// One row
+$select_sql = "SELECT id, value FROM ".$schema.$table_name." WHERE ROWNUM < 2";
+
+if (!($s = oci_parse($c, $select_sql))) {
+ die("oci_parse(select) failed!\n");
+}
+
+if (!oci_execute($s)) {
+ die("oci_execute(select) failed!\n");
+}
+
+if (oci_fetch_all($s,$r) === false) {
+ die("oci_fetch_all(select) failed!\n");
+}
+
+echo "Test 6\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// No rows
+$select_sql = "SELECT id FROM ".$schema.$table_name." WHERE 1=0";
+
+if (!($s = oci_parse($c, $select_sql))) {
+ die("oci_parse(select) failed!\n");
}
if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
+ die("oci_execute(select) failed!\n");
+}
+
+if (oci_fetch_all($s,$r) === false) {
+ die("oci_fetch_all(select) failed!\n");
}
+echo "Test 7\n";
var_dump(ocirowcount($s));
var_dump(oci_num_rows($s));
var_dump(ocinumcols($s));
@@ -48,19 +133,89 @@
if (!oci_execute($s)) {
die("oci_execute(delete) failed!\n");
}
+
+echo "Test 8a\n";
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
oci_commit($c);
+echo "Test 8b\n";
+var_dump(ocirowcount($s));
var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
require dirname(__FILE__).'/drop_table.inc';
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
+Test 1
+
+Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+Test 2
+int(0)
int(0)
int(0)
+int(0)
+Test 3
+int(1)
+int(1)
+int(0)
+int(0)
+Test 4
+int(1)
+int(1)
+int(0)
+int(0)
+Test 5a
+int(0)
+int(0)
+int(0)
+int(0)
+Test 5b
+int(0)
+int(0)
+int(5)
+int(5)
+Test 5c
+int(3)
+int(3)
int(5)
int(5)
+Test 6
+int(1)
+int(1)
+int(2)
+int(2)
+Test 7
+int(0)
+int(0)
+int(1)
+int(1)
+Test 8a
+int(3)
int(3)
+int(0)
+int(0)
+Test 8b
+int(3)
+int(3)
+int(0)
+int(0)
Done
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_type.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/oci8/tests/statement_type.phpt
diff -u php-src/ext/oci8/tests/statement_type.phpt:1.5
php-src/ext/oci8/tests/statement_type.phpt:1.6
--- php-src/ext/oci8/tests/statement_type.phpt:1.5 Fri Dec 22 13:28:46 2006
+++ php-src/ext/oci8/tests/statement_type.phpt Wed Dec 27 09:48:05 2006
@@ -12,7 +12,8 @@
"DELETE FROM table WHERE id = 1",
"INSERT INTO table VALUES(1)",
"UPDATE table SET id = 1",
- "DROP TABLE table",
+ "DROP TABLE table",
+ "CREATE OR REPLACE PROCEDURE myproc(v1 NUMBER) as BEGIN
DBMS_OUTPUT.PUT_LINE(v1); END;",
"CREATE TABLE table (id NUMBER)",
"ALTER TABLE table ADD (col1 NUMBER)",
"BEGIN NULL; END;",
@@ -37,6 +38,7 @@
string(6) "UPDATE"
string(4) "DROP"
string(6) "CREATE"
+string(6) "CREATE"
string(5) "ALTER"
string(5) "BEGIN"
string(7) "DECLARE"
@@ -51,6 +53,7 @@
unicode(6) "UPDATE"
unicode(4) "DROP"
unicode(6) "CREATE"
+unicode(6) "CREATE"
unicode(5) "ALTER"
unicode(5) "BEGIN"
unicode(7) "DECLARE"
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_type_old.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/oci8/tests/statement_type_old.phpt
diff -u php-src/ext/oci8/tests/statement_type_old.phpt:1.4
php-src/ext/oci8/tests/statement_type_old.phpt:1.5
--- php-src/ext/oci8/tests/statement_type_old.phpt:1.4 Tue Dec 12 10:31:36 2006
+++ php-src/ext/oci8/tests/statement_type_old.phpt Wed Dec 27 09:48:05 2006
@@ -15,14 +15,19 @@
}
$sqls = Array(
- "SELECT * FROM table",
- "DELETE FROM table WHERE id = 1",
- "INSERT INTO table VALUES(1)",
- "UPDATE table SET id = 1",
+ "SELECT * FROM table",
+ "DELETE FROM table WHERE id = 1",
+ "INSERT INTO table VALUES(1)",
+ "UPDATE table SET id = 1",
"DROP TABLE table",
- "CREATE TABLE table (id NUMBER)",
- "WRONG SYNTAX",
- ""
+ "CREATE OR REPLACE PROCEDURE myproc(v1 NUMBER) as BEGIN
DBMS_OUTPUT.PUT_LINE(v1); END;",
+ "CREATE TABLE table (id NUMBER)",
+ "ALTER TABLE table ADD (col1 NUMBER)",
+ "BEGIN NULL; END;",
+ "DECLARE myn NUMBER BEGIN myn := 1; END;",
+ "CALL myproc(1)",
+ "WRONG SYNTAX",
+ ""
);
foreach ($sqls as $sql) {
@@ -41,6 +46,11 @@
string(6) "UPDATE"
string(4) "DROP"
string(6) "CREATE"
+string(6) "CREATE"
+string(5) "ALTER"
+string(5) "BEGIN"
+string(7) "DECLARE"
+string(4) "CALL"
string(7) "UNKNOWN"
string(7) "UNKNOWN"
Done
@@ -52,6 +62,11 @@
unicode(6) "UPDATE"
unicode(4) "DROP"
unicode(6) "CREATE"
+unicode(6) "CREATE"
+unicode(5) "ALTER"
+unicode(5) "BEGIN"
+unicode(7) "DECLARE"
+unicode(4) "CALL"
unicode(7) "UNKNOWN"
unicode(7) "UNKNOWN"
Done
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/function_aliases.phpt?view=markup&rev=1.1
Index: php-src/ext/oci8/tests/function_aliases.phpt
+++ php-src/ext/oci8/tests/function_aliases.phpt
--TEST--
Existence of old function aliases
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--FILE--
<?php
var_dump(oci_free_cursor());
var_dump(ocifreecursor());
var_dump(ocibindbyname());
var_dump(ocidefinebyname());
var_dump(ocicolumnisnull());
var_dump(ocicolumnname());
var_dump(ocicolumnsize());
var_dump(ocicolumnscale());
var_dump(ocicolumnprecision());
var_dump(ocicolumntype());
var_dump(ocicolumntyperaw());
var_dump(ociexecute());
var_dump(ocicancel());
var_dump(ocifetch());
var_dump(ocifetchstatement());
var_dump(ocifreestatement());
var_dump(ociinternaldebug());
var_dump(ocinumcols());
var_dump(ociparse());
var_dump(ocinewcursor());
var_dump(ociresult());
var_dump(ociserverversion());
var_dump(ocistatementtype());
var_dump(ocirowcount());
var_dump(ocilogoff());
var_dump(ocilogon());
var_dump(ocinlogon());
var_dump(ociplogon());
var_dump(ocierror());
var_dump(ocifreedesc());
var_dump(ocisavelob());
var_dump(ocisavelobfile());
var_dump(ociwritelobtofile());
var_dump(ociloadlob());
var_dump(ocicommit());
var_dump(ocirollback());
var_dump(ocinewdescriptor());
var_dump(ocisetprefetch());
var_dump(ocipasswordchange());
var_dump(ocifreecollection());
var_dump(ocinewcollection());
var_dump(ocicollappend());
var_dump(ocicollgetelem());
var_dump(ocicollassignelem());
var_dump(ocicollsize());
var_dump(ocicollmax());
var_dump(ocicolltrim());
echo "Done\n";
?>
--EXPECTF--
Warning: oci_free_cursor() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocifreecursor() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocibindbyname() expects at least 3 parameters, 0 given in %s on line %d
NULL
Warning: ocidefinebyname() expects at least 3 parameters, 0 given in %s on line
%d
NULL
Warning: ocicolumnisnull() expects exactly 2 parameters, 0 given in %s on line
%d
bool(false)
Warning: ocicolumnname() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
Warning: ocicolumnsize() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
Warning: ocicolumnscale() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
Warning: ocicolumnprecision() expects exactly 2 parameters, 0 given in %s on
line %d
bool(false)
Warning: ocicolumntype() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
Warning: ocicolumntyperaw() expects exactly 2 parameters, 0 given in %s on line
%d
bool(false)
Warning: ociexecute() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: ocicancel() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocifetch() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocifetchstatement() expects at least 2 parameters, 0 given in %s on
line %d
NULL
Warning: ocifreestatement() expects exactly 1 parameter, 0 given in %s on line
%d
NULL
Warning: ociinternaldebug() expects exactly 1 parameter, 0 given in %s on line
%d
NULL
Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ociparse() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: ocinewcursor() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ociresult() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
Warning: ociserverversion() expects exactly 1 parameter, 0 given in %s on line
%d
NULL
Warning: ocistatementtype() expects exactly 1 parameter, 0 given in %s on line
%d
NULL
Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocilogoff() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocilogon() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: ocinlogon() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: ociplogon() expects at least 2 parameters, 0 given in %s on line %d
NULL
bool(false)
Warning: ocifreedesc() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocisavelob() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: ocisavelobfile() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: ociwritelobtofile() expects at least 2 parameters, 0 given in %s on
line %d
NULL
Warning: ociloadlob() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocicommit() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocirollback() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocinewdescriptor() expects at least 1 parameter, 0 given in %s on line
%d
NULL
Warning: ocisetprefetch() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for ocipasswordchange() in %s on line %d
NULL
Warning: ocifreecollection() expects exactly 1 parameter, 0 given in %s on line
%d
NULL
Warning: ocinewcollection() expects at least 2 parameters, 0 given in %s on
line %d
NULL
Warning: ocicollappend() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: ocicollgetelem() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: ocicollassignelem() expects exactly 3 parameters, 0 given in %s on
line %d
NULL
Warning: ocicollsize() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocicollmax() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: ocicolltrim() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Done
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_aliases.phpt?view=markup&rev=1.1
Index: php-src/ext/oci8/tests/lob_aliases.phpt
+++ php-src/ext/oci8/tests/lob_aliases.phpt
--TEST--
LOB method aliases
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--FILE--
<?php
// Function existence
echo "Test 1\n";
var_dump(oci_lob_load());
var_dump(oci_lob_tell());
var_dump(oci_lob_truncate());
var_dump(oci_lob_erase());
var_dump(oci_lob_flush());
var_dump(ocisetbufferinglob());
var_dump(ocigetbufferinglob());
var_dump(oci_lob_rewind());
var_dump(oci_lob_read());
var_dump(oci_lob_eof());
var_dump(oci_lob_seek());
var_dump(oci_lob_write());
var_dump(oci_lob_append());
var_dump(oci_lob_size());
var_dump(oci_lob_export());
var_dump(oci_lob_export());
var_dump(oci_lob_import());
// No PHP_FE for oci_lob_write_temporary() or oci_lob_close()
//var_dump(oci_lob_write_temporary());
//var_dump(oci_lob_close());
var_dump(oci_lob_save());
var_dump(oci_lob_import());
var_dump(oci_free_descriptor());
echo "Done\n";
?>
--EXPECTF--
Test 1
Warning: oci_lob_load() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_tell() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_truncate() expects at least 1 parameter, 0 given in %s on line
%d
NULL
Warning: oci_lob_erase() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_flush() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: ocisetbufferinglob() expects exactly 2 parameters, 0 given in %s on
line %d
NULL
Warning: ocigetbufferinglob() expects exactly 1 parameter, 0 given in %s on
line %d
NULL
Warning: oci_lob_rewind() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_read() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_eof() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_seek() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_write() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_append() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_size() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: oci_lob_export() expects at least 2 parameters, 0 given in %s on line
%d
NULL
Warning: oci_lob_export() expects at least 2 parameters, 0 given in %s on line
%d
NULL
Warning: oci_lob_import() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_save() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_lob_import() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: oci_free_descriptor() expects exactly 1 parameter, 0 given in %s on
line %d
NULL
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php