summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-08-28 14:31:19 +0000
committerZoe Slattery <zoe@php.net>2009-08-28 14:31:19 +0000
commit0e4ce3bccac84196ce15f488735b7b8187978744 (patch)
tree972c5f4e245f2a95332b20ce0fd51a79e5ec4424 /ext/gd
parent9bf747605df02a95abb80ad0216a39e9059d54e1 (diff)
downloadphp-git-0e4ce3bccac84196ce15f488735b7b8187978744.tar.gz
More tests from 2009 testfest
Diffstat (limited to 'ext/gd')
-rwxr-xr-xext/gd/tests/imageellipse_error8.phpt21
-rwxr-xr-xext/gd/tests/imagefilltoborder_error7.phpt26
-rwxr-xr-xext/gd/tests/imagerectangle_error1.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error3.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error4.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error5.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error6.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error7.phpt19
-rwxr-xr-xext/gd/tests/imagerectangle_error8.phpt19
9 files changed, 180 insertions, 0 deletions
diff --git a/ext/gd/tests/imageellipse_error8.phpt b/ext/gd/tests/imageellipse_error8.phpt
new file mode 100755
index 0000000000..3fefb56bde
--- /dev/null
+++ b/ext/gd/tests/imageellipse_error8.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Testing wrong param passing imageellipse() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-20
+--SKIPIF--
+<?php
+if ( ! extension_loaded("gd") ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+
+// Create a image
+$image = imagecreatetruecolor( 400, 300 );
+
+// try to draw a white ellipse
+imageellipse( $image, 200, 150, 300, 200 );
+
+?>
+--EXPECTF--
+Warning: imageellipse() expects exactly 6 parameters, %d given in %s on line %d
diff --git a/ext/gd/tests/imagefilltoborder_error7.phpt b/ext/gd/tests/imagefilltoborder_error7.phpt
new file mode 100755
index 0000000000..aeb7d82620
--- /dev/null
+++ b/ext/gd/tests/imagefilltoborder_error7.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Testing wrong param passing imagefilltoborder() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded("gd")) die("skip GD not present; skipping test");
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
+
+// Draw an ellipse to fill with a black border
+imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
+
+// Try to fill border
+imagefilltoborder( $image, 50, 50 );
+
+?>
+--EXPECTF--
+Warning: imagefilltoborder() expects exactly 5 parameters, %d given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error1.phpt b/ext/gd/tests/imagerectangle_error1.phpt
new file mode 100755
index 0000000000..2b4235e854
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error1.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( 'wrong param', 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 1 to be resource, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error3.phpt b/ext/gd/tests/imagerectangle_error3.phpt
new file mode 100755
index 0000000000..d5dd4c1d80
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error3.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 'wrong param', 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 2 to be long, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error4.phpt b/ext/gd/tests/imagerectangle_error4.phpt
new file mode 100755
index 0000000000..7ecc4167a8
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error4.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 0, 'wrong param', 50, 50, imagecolorallocate($image, 255, 255, 255) );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 3 to be long, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error5.phpt b/ext/gd/tests/imagerectangle_error5.phpt
new file mode 100755
index 0000000000..b4288d270c
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error5.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 0, 0, 'wrong param', 50, imagecolorallocate($image, 255, 255, 255) );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 4 to be long, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error6.phpt b/ext/gd/tests/imagerectangle_error6.phpt
new file mode 100755
index 0000000000..aab378e557
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error6.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 0, 0, 50, 'wrong param', imagecolorallocate($image, 255, 255, 255) );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 5 to be long, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error7.phpt b/ext/gd/tests/imagerectangle_error7.phpt
new file mode 100755
index 0000000000..f6ed778db7
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error7.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 0, 0, 50, 50, 'wrong param' );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects parameter 6 to be long, %s given in %s on line %d
diff --git a/ext/gd/tests/imagerectangle_error8.phpt b/ext/gd/tests/imagerectangle_error8.phpt
new file mode 100755
index 0000000000..361de69cde
--- /dev/null
+++ b/ext/gd/tests/imagerectangle_error8.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing wrong param passing imagerectangle() of GD library
+--CREDITS--
+Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+#testfest PHPSP on 2009-06-30
+--SKIPIF--
+<?php
+if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
+?>
+--FILE--
+<?php
+// Create a image
+$image = imagecreatetruecolor( 100, 100 );
+
+// Draw a rectangle
+imagerectangle( $image, 0, 0, 50, 50 );
+?>
+--EXPECTF--
+Warning: imagerectangle() expects exactly 6 parameters, %d given in %s on line %d