]> granicus.if.org Git - php/commitdiff
More tests from 2009 testfest
authorZoe Slattery <zoe@php.net>
Fri, 28 Aug 2009 14:31:19 +0000 (14:31 +0000)
committerZoe Slattery <zoe@php.net>
Fri, 28 Aug 2009 14:31:19 +0000 (14:31 +0000)
12 files changed:
ext/gd/tests/imageellipse_error8.phpt [new file with mode: 0755]
ext/gd/tests/imagefilltoborder_error7.phpt [new file with mode: 0755]
ext/gd/tests/imagerectangle_error1.phpt [new file with mode: 0755]
ext/gd/tests/imagerectangle_error3.phpt [new file with mode: 0755]
ext/gd/tests/imagerectangle_error8.phpt [new file with mode: 0755]
ext/posix/tests/posix_ctermid_error.phpt [new file with mode: 0644]
ext/posix/tests/posix_errno_error.phpt [new file with mode: 0644]
ext/posix/tests/posix_geteuid_error1.phpt [new file with mode: 0644]
ext/standard/tests/array/key_exists_error.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/get_cfg_var_error.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/getservbyname_error.phpt [new file with mode: 0755]
ext/standard/tests/general_functions/getservbyport_error.phpt [new file with mode: 0644]

diff --git a/ext/gd/tests/imageellipse_error8.phpt b/ext/gd/tests/imageellipse_error8.phpt
new file mode 100755 (executable)
index 0000000..3575e0b
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--\r
+Testing wrong param passing imageellipse() of GD library\r
+--CREDITS--\r
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>\r
+#testfest PHPSP on 2009-06-20\r
+--SKIPIF--\r
+<?php \r
+if ( ! extension_loaded("gd") ) die( 'skip GD not present; skipping test' );\r
+?>\r
+--FILE--\r
+<?php\r
+\r
+// Create a image\r
+$image = imagecreatetruecolor( 400, 300 );\r
+\r
+// try to draw a white ellipse\r
+imageellipse( $image, 200, 150, 300, 200 );\r
+\r
+?>\r
+--EXPECTF--\r
+Warning: Wrong parameter count for imageellipse() in %s.php on line %d
diff --git a/ext/gd/tests/imagefilltoborder_error7.phpt b/ext/gd/tests/imagefilltoborder_error7.phpt
new file mode 100755 (executable)
index 0000000..8641812
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST-- \r
+Testing wrong param passing imagefilltoborder() of GD library \r
+--CREDITS-- \r
+Ivan Rosolen <contato [at] ivanrosolen [dot] com> \r
+#testfest PHPSP on 2009-06-30\r
+--SKIPIF-- \r
+<?php  \r
+if ( ! extension_loaded("gd")) die("skip GD not present; skipping test"); \r
+?> \r
+--FILE--\r
+<?php\r
+// Create a image \r
+$image = imagecreatetruecolor( 100, 100 ); \r
+\r
+// Draw a rectangle\r
+imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );\r
+\r
+// Draw an ellipse to fill with a black border\r
+imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );\r
+\r
+// Try to fill border\r
+imagefilltoborder( $image, 50, 50 );\r
+\r
+?> \r
+--EXPECTF--\r
+Warning: Wrong parameter count for imagefilltoborder() in %s.php on line %d
diff --git a/ext/gd/tests/imagerectangle_error1.phpt b/ext/gd/tests/imagerectangle_error1.phpt
new file mode 100755 (executable)
index 0000000..f5b557c
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST-- \r
+Testing wrong param passing imagerectangle() of GD library \r
+--CREDITS-- \r
+Ivan Rosolen <contato [at] ivanrosolen [dot] com> \r
+#testfest PHPSP on 2009-06-30\r
+--SKIPIF-- \r
+<?php  \r
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' ); \r
+?> \r
+--FILE--\r
+<?php\r
+// Create a image \r
+$image = imagecreatetruecolor( 100, 100 ); \r
+\r
+// Draw a rectangle\r
+imagerectangle( 'wrong param', 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );\r
+?> \r
+--EXPECTF--\r
+Warning: imagerectangle(): supplied argument is not a valid Image resource in %s.php on line %d
diff --git a/ext/gd/tests/imagerectangle_error3.phpt b/ext/gd/tests/imagerectangle_error3.phpt
new file mode 100755 (executable)
index 0000000..4bf00cb
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST-- \r
+Testing wrong param passing imagerectangle() of GD library \r
+--CREDITS-- \r
+Ivan Rosolen <contato [at] ivanrosolen [dot] com> \r
+#testfest PHPSP on 2009-06-30\r
+--SKIPIF-- \r
+<?php  \r
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' ); \r
+?> \r
+--FILE--\r
+<?php\r
+// Create a image \r
+$image = imagecreatetruecolor( 100, 100 ); \r
+\r
+// Draw a rectangle\r
+imagerectangle( $image, 'wrong param', 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );\r
+?> \r
+--EXPECTF--\r
diff --git a/ext/gd/tests/imagerectangle_error8.phpt b/ext/gd/tests/imagerectangle_error8.phpt
new file mode 100755 (executable)
index 0000000..19fa3c4
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST-- \r
+Testing wrong param passing imagerectangle() of GD library \r
+--CREDITS-- \r
+Ivan Rosolen <contato [at] ivanrosolen [dot] com> \r
+#testfest PHPSP on 2009-06-30\r
+--SKIPIF-- \r
+<?php  \r
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' ); \r
+?> \r
+--FILE--\r
+<?php\r
+// Create a image \r
+$image = imagecreatetruecolor( 100, 100 ); \r
+\r
+// Draw a rectangle\r
+imagerectangle( $image, 0, 0, 50, 50 );\r
+?> \r
+--EXPECTF--\r
+Warning: Wrong parameter count for imagerectangle() in %s.php on line %d
diff --git a/ext/posix/tests/posix_ctermid_error.phpt b/ext/posix/tests/posix_ctermid_error.phpt
new file mode 100644 (file)
index 0000000..30a69ae
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Test function posix_ctermid() by calling it more than or less than its expected arguments
+--SKIPIF--
+<?php
+        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
+?>
+--CREDITS--
+Marco Fabbri mrfabbri@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+
+var_dump( posix_ctermid( 'foo' ) );
+
+?>
+--EXPECTF--
+Warning: Wrong parameter count for posix_ctermid() in %s.php on line %d
+NULL
diff --git a/ext/posix/tests/posix_errno_error.phpt b/ext/posix/tests/posix_errno_error.phpt
new file mode 100644 (file)
index 0000000..99a2cb3
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Test function posix_errno() by calling it with its expected arguments
+--SKIPIF--
+<?php
+        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
+?>
+--CREDITS--
+Morten Amundsen mor10am@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+
+echo "*** Test by calling method or function with more than expected arguments ***\n";
+
+// test without any error
+var_dump(posix_errno('bar'));
+
+?>
+--EXPECTF--
+*** Test by calling method or function with more than expected arguments ***
+
+Warning: Wrong parameter count for posix_errno() in %s.php on line %d
+NULL
diff --git a/ext/posix/tests/posix_geteuid_error1.phpt b/ext/posix/tests/posix_geteuid_error1.phpt
new file mode 100644 (file)
index 0000000..a7313c6
--- /dev/null
@@ -0,0 +1,37 @@
+--TEST--
+Test function posix_geteuid() by calling it more than or less than its expected arguments
+--SKIPIF--
+<?php 
+        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 
+?>
+--CREDITS--
+Marco Fabbri mrfabbri@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
+
+$extra_args = array( 12312, 2 => '1234', 'string' => 'string' );
+
+var_dump( posix_geteuid( $extra_args ));
+foreach ( $extra_args as $arg )
+{
+       var_dump(posix_geteuid( $arg ));
+}
+
+?>
+--EXPECTF--
+*** Test by calling method or function with incorrect numbers of arguments ***
+
+Warning: Wrong parameter count for posix_geteuid() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for posix_geteuid() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for posix_geteuid() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for posix_geteuid() in %s.php on line %d
+NULL
diff --git a/ext/standard/tests/array/key_exists_error.phpt b/ext/standard/tests/array/key_exists_error.phpt
new file mode 100644 (file)
index 0000000..07abdfd
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Test function key_exists() by calling it more than or less than its expected arguments
+--CREDITS--
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+
+echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
+
+$a = array('bar' => 1);  
+var_dump(key_exists());
+var_dump(key_exists('foo', $a, 'baz'));
+
+?>
+--EXPECTF--
+*** Test by calling method or function with incorrect numbers of arguments ***
+
+Warning: Wrong parameter count for key_exists() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for key_exists() in %s.php on line %d
+NULL
diff --git a/ext/standard/tests/general_functions/get_cfg_var_error.phpt b/ext/standard/tests/general_functions/get_cfg_var_error.phpt
new file mode 100644 (file)
index 0000000..427b860
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Test function get_cfg_var() by calling it more than or less than its expected arguments
+--CREDITS--
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--INI--
+session.use_cookies=0
+session.serialize_handler=php
+session.save_handler=files
+--FILE--
+<?php
+
+echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
+
+var_dump(get_cfg_var( 'session.use_cookies', 'session.serialize_handler' ) );
+var_dump(get_cfg_var(  ) );
+
+
+?>
+--EXPECTF--
+*** Test by calling method or function with incorrect numbers of arguments ***
+
+Warning: Wrong parameter count for get_cfg_var() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for get_cfg_var() in %s.php on line %d
+NULL
diff --git a/ext/standard/tests/general_functions/getservbyname_error.phpt b/ext/standard/tests/general_functions/getservbyname_error.phpt
new file mode 100755 (executable)
index 0000000..3169e9a
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Test function getservbyname() by calling it more than or less than its expected arguments
+--CREDITS--
+Italian PHP TestFest 2009 Cesena 19-20-21 june
+Fabio Fabbrucci (fabbrucci@grupporetina.com)
+Michele Orselli (mo@ideato.it)
+Danilo Sanchi (sanchi@grupporetina.com)
+--FILE--
+<?php
+$service = "www";
+$protocol = "tcp"; 
+$extra_arg = 12;
+var_dump(getservbyname($service, $protocol, $extra_arg ) );
+var_dump(getservbyname($service));
+?>
+--EXPECTF--
+Warning: Wrong parameter count for getservbyname() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for getservbyname() in %s.php on line %d
+NULL
diff --git a/ext/standard/tests/general_functions/getservbyport_error.phpt b/ext/standard/tests/general_functions/getservbyport_error.phpt
new file mode 100644 (file)
index 0000000..7cd606c
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Test function getservbyport() by calling it more than or less than its expected arguments
+--CREDITS--
+Italian PHP TestFest 2009 Cesena 19-20-21 june
+Fabio Fabbrucci (fabbrucci@grupporetina.com)
+Michele Orselli (mo@ideato.it)
+Simone Gentili (sensorario@gmail.com)
+--FILE--
+<?php
+$port = 80;
+$protocol = "tcp"; 
+$extra_arg = 12;
+var_dump(getservbyport( $port, $protocol, $extra_arg ) );
+var_dump(getservbyport($port));
+?>
+--EXPECTF--
+Warning: Wrong parameter count for getservbyport() in %s.php on line %d
+NULL
+
+Warning: Wrong parameter count for getservbyport() in %s.php on line %d
+NULL