helly           Wed Oct 23 19:51:15 2002 EDT

  Modified files:              
    /php4/ext/exif/tests        001.phpt 003.phpt 
  Log:
  better use var_dump and EXPECTF
  #seems i waited for EXPECTF
  
  
Index: php4/ext/exif/tests/001.phpt
diff -u php4/ext/exif/tests/001.phpt:1.8 php4/ext/exif/tests/001.phpt:1.9
--- php4/ext/exif/tests/001.phpt:1.8    Sat Jun 22 20:26:34 2002
+++ php4/ext/exif/tests/001.phpt        Wed Oct 23 19:51:15 2002
@@ -2,8 +2,6 @@
 Check for exif_read_data
 --SKIPIF--
 <?php if (!extension_loaded("exif")) print "skip";?>
---POST--
---GET--
 --FILE--
 <?php
 /*
@@ -11,18 +9,73 @@
   test2.jpg is the same image but contains Exif/Comment information and a
             copy of test1.jpg as a thumbnail.
 */
-$image  = exif_read_data('./ext/exif/tests/test2.jpg','',true,false);
-$accept = '';
-foreach($image as $idx=>$section) {
-       $accept .= $section;
-       foreach($section as $name=>$value) {
-               if  ( $idx!='FILE' || $name!='FileDateTime') {
-                       $accept .= substr($name,0,2);
-                       $accept .= $value;
-               }
-       }
-}
-echo $accept;
+var_dump(exif_read_data('./ext/exif/tests/test2.jpg','',true,false));
 ?>
---EXPECT--
-ArrayFitest2.jpgFi1240Fi2Miimage/jpegSeANY_TAG, IFD0, THUMBNAIL, 
COMMENTArrayhtwidth="1" height="1"He1Wi1Is1By1UsExif test image.UsASCIICoPhoto (c) 
M.Boerger, Edited by M.Boerger.CoPhoto (c) M.BoergerCoEdited by 
M.Boerger.Th2Thimage/jpegArrayCoPhoto (c) M.BoergerUsASCIIArrayJP134JP523Array0Comment 
#1.1Comment #2.2Comment #3end
\ No newline at end of file
+--EXPECTF--
+array(5) {
+  ["FILE"]=>
+  array(6) {
+    ["FileName"]=>
+    string(9) "test2.jpg"
+    ["FileDateTime"]=>
+    int(%d)
+    ["FileSize"]=>
+    int(1240)
+    ["FileType"]=>
+    int(2)
+    ["MimeType"]=>
+    string(10) "image/jpeg"
+    ["SectionsFound"]=>
+    string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT"
+  }
+  ["COMPUTED"]=>
+  array(12) {
+    ["html"]=>
+    string(20) "width="1" height="1""
+    ["Height"]=>
+    int(1)
+    ["Width"]=>
+    int(1)
+    ["IsColor"]=>
+    int(1)
+    ["ByteOrderMotorola"]=>
+    int(1)
+    ["UserComment"]=>
+    string(16) "Exif test image."
+    ["UserCommentEncoding"]=>
+    string(5) "ASCII"
+    ["Copyright"]=>
+    string(41) "Photo (c) M.Boerger, Edited by M.Boerger."
+    ["Copyright.Photographer"]=>
+    string(19) "Photo (c) M.Boerger"
+    ["Copyright.Editor"]=>
+    string(20) "Edited by M.Boerger."
+    ["Thumbnail.FileType"]=>
+    int(2)
+    ["Thumbnail.MimeType"]=>
+    string(10) "image/jpeg"
+  }
+  ["IFD0"]=>
+  array(2) {
+    ["Copyright"]=>
+    string(19) "Photo (c) M.Boerger"
+    ["UserComment"]=>
+    string(5) "ASCII"
+  }
+  ["THUMBNAIL"]=>
+  array(2) {
+    ["JPEGInterchangeFormat"]=>
+    int(134)
+    ["JPEGInterchangeFormatLength"]=>
+    int(523)
+  }
+  ["COMMENT"]=>
+  array(3) {
+    [0]=>
+    string(11) "Comment #1."
+    [1]=>
+    string(11) "Comment #2."
+    [2]=>
+    string(13) "Comment #3end"
+  }
+}
\ No newline at end of file
Index: php4/ext/exif/tests/003.phpt
diff -u php4/ext/exif/tests/003.phpt:1.7 php4/ext/exif/tests/003.phpt:1.8
--- php4/ext/exif/tests/003.phpt:1.7    Wed Aug 21 19:14:40 2002
+++ php4/ext/exif/tests/003.phpt        Wed Oct 23 19:51:15 2002
@@ -15,18 +15,73 @@
             copy of test1.jpg as a thumbnail.
   test3.jpg is the same as test2.jpg but with a UNICODE UserComment: 
&Auml;&Ouml;&&Uuml;&szlig;&auml;&ouml;&uuml;
 */
-$image  = exif_read_data('./ext/exif/tests/test3.jpg','',true,false);
-$accept = '';
-foreach($image as $idx=>$section) {
-       $accept .= $section;
-       foreach($section as $name=>$value) {
-               if  ( $idx!='FILE' || $name!='FileDateTime') {
-                       $accept .= substr($name,0,2);
-                       $accept .= $value;
-               }
-       }
-}
-echo $accept;
+var_dump(exif_read_data('./ext/exif/tests/test3.jpg','',true,false));
 ?>
---EXPECT--
-ArrayFitest3.jpgFi1240Fi2Miimage/jpegSeANY_TAG, IFD0, THUMBNAIL, 
COMMENTArrayhtwidth="1" height="1"He1Wi1Is1By1UsÄÖÜßäöüUsUNICODECoPhoto (c) M.Boerger, 
Edited by M.Boerger.CoPhoto (c) M.BoergerCoEdited by 
M.Boerger.Th2Thimage/jpegArrayCoPhoto (c) 
M.BoergerUsUNICODEArrayJP134JP523Array0Comment #1.1Comment #2.2Comment #3end
\ No newline at end of file
+--EXPECTF--
+array(5) {
+  ["FILE"]=>
+  array(6) {
+    ["FileName"]=>
+    string(9) "test3.jpg"
+    ["FileDateTime"]=>
+    int(%s)
+    ["FileSize"]=>
+    int(1240)
+    ["FileType"]=>
+    int(2)
+    ["MimeType"]=>
+    string(10) "image/jpeg"
+    ["SectionsFound"]=>
+    string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT"
+  }
+  ["COMPUTED"]=>
+  array(12) {
+    ["html"]=>
+    string(20) "width="1" height="1""
+    ["Height"]=>
+    int(1)
+    ["Width"]=>
+    int(1)
+    ["IsColor"]=>
+    int(1)
+    ["ByteOrderMotorola"]=>
+    int(1)
+    ["UserComment"]=>
+    string(7) "ÄÖÜßäöü"
+    ["UserCommentEncoding"]=>
+    string(7) "UNICODE"
+    ["Copyright"]=>
+    string(41) "Photo (c) M.Boerger, Edited by M.Boerger."
+    ["Copyright.Photographer"]=>
+    string(19) "Photo (c) M.Boerger"
+    ["Copyright.Editor"]=>
+    string(20) "Edited by M.Boerger."
+    ["Thumbnail.FileType"]=>
+    int(2)
+    ["Thumbnail.MimeType"]=>
+    string(10) "image/jpeg"
+  }
+  ["IFD0"]=>
+  array(2) {
+    ["Copyright"]=>
+    string(19) "Photo (c) M.Boerger"
+    ["UserComment"]=>
+    string(7) "UNICODE"
+  }
+  ["THUMBNAIL"]=>
+  array(2) {
+    ["JPEGInterchangeFormat"]=>
+    int(134)
+    ["JPEGInterchangeFormatLength"]=>
+    int(523)
+  }
+  ["COMMENT"]=>
+  array(3) {
+    [0]=>
+    string(11) "Comment #1."
+    [1]=>
+    string(11) "Comment #2."
+    [2]=>
+    string(13) "Comment #3end"
+  }
+}
\ 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