]> granicus.if.org Git - php/commitdiff
better use var_dump and EXPECTF
authorMarcus Boerger <helly@php.net>
Wed, 23 Oct 2002 23:51:15 +0000 (23:51 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 23 Oct 2002 23:51:15 +0000 (23:51 +0000)
#seems i waited for EXPECTF

ext/exif/tests/001.phpt
ext/exif/tests/003.phpt

index 69f0e2894f05083fc88117eff57c0fc6480b60f9..a66fc5ff52c3f91c07f91cfc2cd0a7ec3787e9e9 100644 (file)
@@ -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 @@ Check for exif_read_data
   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 68c1da82f8c2f3cf6c1a81a3d11bf8ea6699c035..79eded29f2df9126afec68601255fd6735789190 100644 (file)
@@ -15,18 +15,73 @@ exif.encode_unicode=ISO-8859-15
             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