tony2001                Fri Mar  2 09:09:50 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/oci8/tests     lob_029.phpt 
  Log:
  improved test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/lob_029.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/oci8/tests/lob_029.phpt
diff -u php-src/ext/oci8/tests/lob_029.phpt:1.1.2.3 
php-src/ext/oci8/tests/lob_029.phpt:1.1.2.4
--- php-src/ext/oci8/tests/lob_029.phpt:1.1.2.3 Tue Dec 12 13:00:01 2006
+++ php-src/ext/oci8/tests/lob_029.phpt Fri Mar  2 09:09:49 2007
@@ -11,19 +11,31 @@
 require dirname(__FILE__).'/connect.inc';
 
 $realdirname = dirname(__FILE__);
-$realfilename = "oci8bfiletest.txt";
-$fullname = $realdirname."/".$realfilename;
+$realfilename1 = "oci8bfiletest1.txt";
+$fullname1 = $realdirname."/".$realfilename1;
+$realfilename2 = "oci8bfiletest2.txt";
+$fullname2 = $realdirname."/".$realfilename2;
+$realfilename3 = "oci8bfiletest3.txt";
+$fullname3 = $realdirname."/".$realfilename3;
 
 // Setup
 $s = oci_parse($c, "create directory TestDir as '$realdirname'");
 oci_execute($s);
 
-file_put_contents($fullname, 'Some text in the bfile');
+file_put_contents($fullname1, 'Some text in the bfile 1');
+file_put_contents($fullname2, 'Some text in the bfile 2');
+file_put_contents($fullname3, 'Some text in the bfile 3');
 
 $s = oci_parse($c, "create table FileTest (FileNum number, FileDesc 
varchar2(30), Image bfile)");
 oci_execute($s);
 
-$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (1, 
'Description 1', bfilename('TESTDIR', '$realfilename'))");
+$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (1, 
'Description 1', bfilename('TESTDIR', '$realfilename1'))");
+oci_execute($s);
+
+$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (2, 
'Description 2', bfilename('TESTDIR', '$realfilename2'))");
+oci_execute($s);
+
+$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (3, 
'Description 3', bfilename('TESTDIR', '$realfilename3'))");
 oci_execute($s);
 
 // Run tests
@@ -36,7 +48,7 @@
 var_dump($res);
 
 echo "Test 2\n";
-$s = oci_parse($c, "select * from FileTest");
+$s = oci_parse($c, "select * from FileTest order by FileNum");
 oci_execute($s);
 oci_fetch_all($s, $res);
 var_dump($res);
@@ -44,14 +56,16 @@
 echo "Test 3\n";
 $d = oci_new_descriptor($c, OCI_D_FILE);
 
-$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (2, 
'Description 2', bfilename('TESTDIR', '$realfilename')) returning Image into 
:im");
+$s = oci_parse($c, "insert into FileTest (FileNum, FileDesc, Image) values (2, 
'Description 2', bfilename('TESTDIR', '$realfilename1')) returning Image into 
:im");
 oci_bind_by_name($s, ":im", $d, -1, OCI_B_BFILE);
 oci_execute($s);
 
 $r = $d->read(40);
 var_dump($r);
 
-unlink($fullname);
+unlink($fullname1);
+unlink($fullname2);
+unlink($fullname3);
 
 $s = oci_parse($c, "drop table FileTest");
 oci_execute($s);
@@ -61,33 +75,45 @@
 
 echo "Done\n";
 ?>
---EXPECTF--    
+--EXPECTF-- 
 Test 1. Check how many rows in the table
 array(1) {
   ["NUMROWS"]=>
   array(1) {
     [0]=>
-    string(1) "1"
+    string(1) "3"
   }
 }
 Test 2
 array(3) {
   ["FILENUM"]=>
-  array(1) {
+  array(3) {
     [0]=>
     string(1) "1"
+    [1]=>
+    string(1) "2"
+    [2]=>
+    string(1) "3"
   }
   ["FILEDESC"]=>
-  array(1) {
+  array(3) {
     [0]=>
     string(13) "Description 1"
+    [1]=>
+    string(13) "Description 2"
+    [2]=>
+    string(13) "Description 3"
   }
   ["IMAGE"]=>
-  array(1) {
+  array(3) {
     [0]=>
-    string(22) "Some text in the bfile"
+    string(24) "Some text in the bfile 1"
+    [1]=>
+    string(24) "Some text in the bfile 2"
+    [2]=>
+    string(24) "Some text in the bfile 3"
   }
 }
 Test 3
-string(22) "Some text in the bfile"
-Done
+string(24) "Some text in the bfile 1"
+Done
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to