tony2001 Fri Dec 22 13:28:46 2006 UTC Added files: /php-src/ext/oci8/tests coll_018.phpt error2.phpt lob_036.phpt
Modified files: /php-src/ext/oci8/tests statement_type.phpt Log: more OCI8 tests by Chris Jones http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_type.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/oci8/tests/statement_type.phpt diff -u php-src/ext/oci8/tests/statement_type.phpt:1.4 php-src/ext/oci8/tests/statement_type.phpt:1.5 --- php-src/ext/oci8/tests/statement_type.phpt:1.4 Wed Dec 6 16:42:27 2006 +++ php-src/ext/oci8/tests/statement_type.phpt Fri Dec 22 13:28:46 2006 @@ -7,22 +7,19 @@ require dirname(__FILE__)."/connect.inc"; -if (!empty($dbase)) { - var_dump($c = oci_connect($user, $password, $dbase)); -} -else { - var_dump($c = oci_connect($user, $password)); -} - $sqls = Array( - "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", - "" + "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)", + "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) { @@ -34,24 +31,30 @@ ?> --EXPECTF-- -resource(%d) of type (oci8 connection) string(6) "SELECT" string(6) "DELETE" string(6) "INSERT" string(6) "UPDATE" string(4) "DROP" string(6) "CREATE" +string(5) "ALTER" +string(5) "BEGIN" +string(7) "DECLARE" +string(4) "CALL" string(7) "UNKNOWN" string(7) "UNKNOWN" Done --UEXPECTF-- -resource(%d) of type (oci8 connection) unicode(6) "SELECT" unicode(6) "DELETE" unicode(6) "INSERT" unicode(6) "UPDATE" unicode(4) "DROP" 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/coll_018.phpt?view=markup&rev=1.1 Index: php-src/ext/oci8/tests/coll_018.phpt +++ php-src/ext/oci8/tests/coll_018.phpt --TEST-- Collection trim tests --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = oci_new_collection($c, $type_name); echo "Test 1.\n"; var_dump($coll1->trim()); echo "\nTest 2.\n"; var_dump($coll1->trim(0)); echo "\nTest 3.\n"; var_dump($coll1->append(1)); var_dump($coll1->append(2)); var_dump($coll1->append(3)); var_dump($coll1->append(4)); var_dump($coll1->getElem(-1)); // check before the beginning var_dump($coll1->getElem(0)); var_dump($coll1->getElem(1)); var_dump($coll1->getElem(2)); var_dump($coll1->getElem(3)); var_dump($coll1->getElem(4)); // check past the end echo "\nTest 4.\n"; var_dump($coll1->trim(1)); var_dump($coll1->getElem(2)); // this should be the last element var_dump($coll1->getElem(3)); // this element should have gone echo "\nTest 5.\n"; var_dump($coll1->trim(2)); var_dump($coll1->getElem(0)); // this should be the last element var_dump($coll1->getElem(1)); // this element should have gone echo "\nTest 6.\n"; var_dump($coll1->trim(0)); var_dump($coll1->getElem(0)); // this should still be the last element echo "\nTest 7.\n"; var_dump($coll1->trim(1)); var_dump($coll1->getElem(0)); // this should have gone echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- Test 1. Warning: OCI-Collection::trim() expects exactly 1 parameter, 0 given in %s on line 9 NULL Test 2. bool(true) Test 3. bool(true) bool(true) bool(true) bool(true) bool(false) float(1) float(2) float(3) float(4) bool(false) Test 4. bool(true) float(3) bool(false) Test 5. bool(true) float(1) bool(false) Test 6. bool(true) float(1) Test 7. bool(true) bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/error2.phpt?view=markup&rev=1.1 Index: php-src/ext/oci8/tests/error2.phpt +++ php-src/ext/oci8/tests/error2.phpt --TEST-- Exercise error code for SUCCESS_WITH_INFO --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php require dirname(__FILE__).'/connect.inc'; ini_set('error_reporting', E_ALL); $s = oci_parse($c, "create or replace procedure myproc as begin bogus end;"); $e = @oci_execute($s); if (!$e) { $es = oci_error($s); echo $es['message']."\n"; } echo "Done\n"; ?> --EXPECTF-- ORA-24344: success with compilation error Done http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_036.phpt?view=markup&rev=1.1 Index: php-src/ext/oci8/tests/lob_036.phpt +++ php-src/ext/oci8/tests/lob_036.phpt --TEST-- Exercise cleanup code when LOB buffering is on --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $s = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_DTYPE_LOB); oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($s, OCI_DEFAULT); var_dump($blob->write("test")); var_dump($blob->setBuffering(true)); var_dump($blob->write("test")); $blob = null; require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(4) bool(true) int(4) Done --UEXPECT-- int(8) bool(true) int(8) Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php