import zend exif tests
It seems we emit an error on unknown file and they don't.
Esse commit está contido em:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/* Prototype : int exif_imagetype ( string $filename )
|
||||
* Description: Determine the type of an image
|
||||
* Source code: ext/exif/exif.c
|
||||
*/
|
||||
|
||||
echo "*** Testing exif_imagetype() : error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing exif_imagetype() function with no arguments --\n";
|
||||
var_dump( exif_imagetype() );
|
||||
|
||||
echo "\n-- Testing exif_imagetype() function with more than expected no. of arguments --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( exif_imagetype(dirname(__FILE__).'/test2.jpg', $extra_arg) );
|
||||
|
||||
echo "\n-- Testing exif_imagetype() function with an unknown file --\n";
|
||||
var_dump( exif_imagetype(dirname(__FILE__).'/foo.jpg') );
|
||||
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -0,0 +1,14 @@
|
||||
*** Testing exif_imagetype() : error conditions ***
|
||||
|
||||
-- Testing exif_imagetype() function with no arguments --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
|
||||
-- Testing exif_imagetype() function with more than expected no. of arguments --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
|
||||
-- Testing exif_imagetype() function with an unknown file --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
===Done===
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/* Prototype : int exif_imagetype ( string $filename )
|
||||
* Description: Determine the type of an image
|
||||
* Source code: ext/exif/exif.c
|
||||
*/
|
||||
|
||||
echo "*** Testing exif_imagetype() : different types for filename argument ***\n";
|
||||
// initialize all required variables
|
||||
|
||||
// get an unset variable
|
||||
$unset_var = 'string_val';
|
||||
unset($unset_var);
|
||||
|
||||
// declaring a class
|
||||
class sample {
|
||||
public function __toString() {
|
||||
return "obj'ct";
|
||||
}
|
||||
}
|
||||
|
||||
// Defining resource
|
||||
$file_handle = fopen(__FILE__, 'r');
|
||||
|
||||
// array with different values
|
||||
$values = array (
|
||||
|
||||
// integer values
|
||||
0,
|
||||
1,
|
||||
12345,
|
||||
-2345,
|
||||
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
array(),
|
||||
array(0),
|
||||
array(1),
|
||||
array(1, 2),
|
||||
array('color' => 'red', 'item' => 'pen'),
|
||||
|
||||
// boolean values
|
||||
true,
|
||||
false,
|
||||
TRUE,
|
||||
FALSE,
|
||||
|
||||
// empty string
|
||||
"",
|
||||
'',
|
||||
|
||||
// undefined variable
|
||||
$undefined_var,
|
||||
|
||||
// unset variable
|
||||
$unset_var,
|
||||
|
||||
// objects
|
||||
new sample(),
|
||||
|
||||
// resource
|
||||
$file_handle,
|
||||
|
||||
NULL,
|
||||
null
|
||||
);
|
||||
|
||||
|
||||
// loop through each element of the array and check the working of exif_imagetype()
|
||||
// when $filename is supplied with different values
|
||||
|
||||
echo "\n--- Testing exif_imagetype() by supplying different values for 'filename' argument ---\n";
|
||||
$counter = 1;
|
||||
foreach($values as $filename) {
|
||||
echo "-- Iteration $counter --\n";
|
||||
var_dump( exif_imagetype($filename) );
|
||||
$counter ++;
|
||||
}
|
||||
|
||||
// closing the file
|
||||
fclose($file_handle);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -0,0 +1,87 @@
|
||||
*** Testing exif_imagetype() : different types for filename argument ***
|
||||
HipHop Notice: %a
|
||||
HipHop Notice: %a
|
||||
|
||||
--- Testing exif_imagetype() by supplying different values for 'filename' argument ---
|
||||
-- Iteration 1 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 2 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 3 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 4 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 5 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 6 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 7 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 8 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 9 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 10 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 11 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 12 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 13 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 14 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 15 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 16 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 17 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 18 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 19 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 20 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 21 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 22 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 23 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 25 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
-- Iteration 26 --
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
Done
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/* Prototype : string exif_tagname ( string $index )
|
||||
* Description: Get the header name for an index
|
||||
* Source code: ext/exif/exif.c
|
||||
*/
|
||||
|
||||
echo "*** Testing exif_tagname() : different types for index argument ***\n";
|
||||
// initialize all required variables
|
||||
|
||||
// get an unset variable
|
||||
$unset_var = 'string_val';
|
||||
unset($unset_var);
|
||||
|
||||
// declaring a class
|
||||
class sample {
|
||||
public function __toString() {
|
||||
return "obj'ct";
|
||||
}
|
||||
}
|
||||
|
||||
// Defining resource
|
||||
$file_handle = fopen(__FILE__, 'r');
|
||||
|
||||
// array with different values
|
||||
$values = array (
|
||||
|
||||
// integer values
|
||||
0,
|
||||
1,
|
||||
12345,
|
||||
-2345,
|
||||
|
||||
// float values
|
||||
10.5,
|
||||
-10.5,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array values
|
||||
array(),
|
||||
array(0),
|
||||
array(1),
|
||||
array(1, 2),
|
||||
array('color' => 'red', 'item' => 'pen'),
|
||||
|
||||
// boolean values
|
||||
true,
|
||||
false,
|
||||
TRUE,
|
||||
FALSE,
|
||||
|
||||
// empty string
|
||||
"",
|
||||
'',
|
||||
|
||||
// undefined variable
|
||||
$undefined_var,
|
||||
|
||||
// unset variable
|
||||
$unset_var,
|
||||
|
||||
// objects
|
||||
new sample(),
|
||||
|
||||
// resource
|
||||
$file_handle,
|
||||
|
||||
NULL,
|
||||
null
|
||||
);
|
||||
|
||||
|
||||
// loop through each element of the array and check the working of exif_tagname()
|
||||
// when $index arugment is supplied with different values
|
||||
|
||||
echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n";
|
||||
$counter = 1;
|
||||
foreach($values as $index) {
|
||||
echo "-- Iteration $counter --\n";
|
||||
var_dump( exif_tagname($index) );
|
||||
$counter ++;
|
||||
}
|
||||
|
||||
// closing the file
|
||||
fclose($file_handle);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -0,0 +1,70 @@
|
||||
*** Testing exif_tagname() : different types for index argument ***
|
||||
HipHop Notice: %a
|
||||
HipHop Notice: %a
|
||||
|
||||
--- Testing exif_tagname() by supplying different values for 'index' argument ---
|
||||
-- Iteration 1 --
|
||||
bool(false)
|
||||
-- Iteration 2 --
|
||||
bool(false)
|
||||
-- Iteration 3 --
|
||||
bool(false)
|
||||
-- Iteration 4 --
|
||||
bool(false)
|
||||
-- Iteration 5 --
|
||||
bool(false)
|
||||
-- Iteration 6 --
|
||||
bool(false)
|
||||
-- Iteration 7 --
|
||||
bool(false)
|
||||
-- Iteration 8 --
|
||||
bool(false)
|
||||
-- Iteration 9 --
|
||||
bool(false)
|
||||
-- Iteration 10 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 11 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 12 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 13 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 14 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 15 --
|
||||
bool(false)
|
||||
-- Iteration 16 --
|
||||
bool(false)
|
||||
-- Iteration 17 --
|
||||
bool(false)
|
||||
-- Iteration 18 --
|
||||
bool(false)
|
||||
-- Iteration 19 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 20 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 21 --
|
||||
bool(false)
|
||||
-- Iteration 22 --
|
||||
bool(false)
|
||||
-- Iteration 23 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 24 --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
-- Iteration 25 --
|
||||
bool(false)
|
||||
-- Iteration 26 --
|
||||
bool(false)
|
||||
Done
|
||||
|
||||
?>
|
||||
===Done===
|
||||
Arquivo binário não exibido.
|
Depois Largura: | Altura: | Tamanho: 2.5 KiB |
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
exif_read_data(
|
||||
dirname(__FILE__) . "/bug48378.jpeg",
|
||||
"FILE,COMPUTED,ANY_TAG"
|
||||
);
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
HipHop Warning: %a
|
||||
HipHop Warning: %a
|
||||
HipHop Warning: %a
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/* Prototype :string exif_tagname ( string $index )
|
||||
* Description: Get the header name for an index
|
||||
* Source code: ext/exif/exif.c
|
||||
*/
|
||||
|
||||
echo "*** Testing exif_tagname() : error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing exif_tagname() function with no arguments --\n";
|
||||
var_dump( exif_tagname() );
|
||||
|
||||
echo "\n-- Testing exif_tagname() function with more than expected no. of arguments --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( exif_tagname(0x10E, $extra_arg) );
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -0,0 +1,10 @@
|
||||
*** Testing exif_tagname() : error conditions ***
|
||||
|
||||
-- Testing exif_tagname() function with no arguments --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
|
||||
-- Testing exif_tagname() function with more than expected no. of arguments --
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
===Done===
|
||||
@@ -104,7 +104,6 @@ no_import = (
|
||||
'pcntl/tests/pcntl_exec_3.phpt',
|
||||
|
||||
# not imported yet, but will be
|
||||
'/ext/exif',
|
||||
'/ext/gd',
|
||||
'/ext/intl',
|
||||
'/ext/ldap',
|
||||
@@ -197,6 +196,8 @@ other_files = (
|
||||
'ns_067.inc',
|
||||
'unset.inc',
|
||||
'tests/quicktester.inc',
|
||||
|
||||
'/ext-exif/bug48378.jpeg',
|
||||
)
|
||||
|
||||
errors = (
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário