File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
image /
image_type_to_mime_type_variation2.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 5 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Test image_type_to_mime_type() function : usage variations - Pass decimal, octal, and hexadecimal values as imagetype
--FILE--
<?php
/* Prototype : string image_type_to_mime_type(int imagetype)
* Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
* Source code: ext/standard/image.c
*/
echo "*** Testing image_type_to_mime_type() : usage variations ***\n";
error_reporting(E_ALL ^ E_NOTICE);
$values = array (
//Decimal values
0,
1,
12345,
-12345,
//Octal values
02,
010,
030071,
-030071,
//Hexadecimal values
0x0,
0x1,
0xABCD,
-0xABCD
);
// loop through each element of the array for imagetype
$iterator = 1;
foreach($values as $value) {
echo "\n-- Iteration $iterator --\n";
var_dump( image_type_to_mime_type($value) );
$iterator++;
};
?>
===DONE===
--EXPECT--
*** Testing image_type_to_mime_type() : usage variations ***
-- Iteration 1 --
string(24) "application/octet-stream"
-- Iteration 2 --
string(9) "image/gif"
-- Iteration 3 --
string(24) "application/octet-stream"
-- Iteration 4 --
string(24) "application/octet-stream"
-- Iteration 5 --
string(10) "image/jpeg"
-- Iteration 6 --
string(10) "image/tiff"
-- Iteration 7 --
string(24) "application/octet-stream"
-- Iteration 8 --
string(24) "application/octet-stream"
-- Iteration 9 --
string(24) "application/octet-stream"
-- Iteration 10 --
string(9) "image/gif"
-- Iteration 11 --
string(24) "application/octet-stream"
-- Iteration 12 --
string(24) "application/octet-stream"
===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>