From: Zoe Slattery Date: Fri, 28 Aug 2009 14:31:19 +0000 (+0000) Subject: More tests from 2009 testfest X-Git-Tag: php-5.4.0alpha1~191^2~2734 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=157453148a4b3d5beebb748f84a5acfe5db22a04;p=php More tests from 2009 testfest --- diff --git a/ext/date/tests/DatePeriod_wrong_constructor.phpt b/ext/date/tests/DatePeriod_wrong_constructor.phpt new file mode 100644 index 0000000000..62e6aa98ac --- /dev/null +++ b/ext/date/tests/DatePeriod_wrong_constructor.phpt @@ -0,0 +1,17 @@ +--TEST-- +DatePeriod: Test wrong __construct parameter +--CREDITS-- +Havard Eide +#PHPTestFest2009 Norway 2009-06-09 \o/ +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' with message 'DatePeriod::__construct(): This constructor accepts either (DateTime, DateInterval, int) OR (DateTime, DateInterval, DateTime) OR (string) as arguments.' in %s:%d +Stack trace: +#0 %s(%d): DatePeriod->__construct() +#1 {main} + thrown in %s on line %d \ No newline at end of file diff --git a/ext/date/tests/date_timestamp_get.phpt b/ext/date/tests/date_timestamp_get.phpt new file mode 100644 index 0000000000..bdd4d047ea --- /dev/null +++ b/ext/date/tests/date_timestamp_get.phpt @@ -0,0 +1,20 @@ +--TEST-- +DateTime: Test correct setup and correct DateTime parameter to date_timestamp_get() +--CREDITS-- +Havard Eide +#PHPTestFest2009 Norway 2009-06-09 \o/ +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +bool(true) + + + +Warning: date_timestamp_get() expects parameter 1 to be DateTime, integer given in %s on line %d \ No newline at end of file diff --git a/ext/date/tests/timezone_identifiers_list_wrong_constructor.phpt b/ext/date/tests/timezone_identifiers_list_wrong_constructor.phpt new file mode 100644 index 0000000000..5b8493ba11 --- /dev/null +++ b/ext/date/tests/timezone_identifiers_list_wrong_constructor.phpt @@ -0,0 +1,15 @@ +--TEST-- +timezone_identifiers_list: Test that correct notice is given when timezone_identifiers_list is given 4096 as parameter +--CREDITS-- +Havard Eide +#PHPTestFest2009 Norway 2009-06-09 \o/ +--INI-- +error_reporting=E_ALL +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Notice: timezone_identifiers_list(): A two-letter ISO 3166-1 compatible country code is expected in %s on line %d \ No newline at end of file diff --git a/ext/date/tests/timezone_location_get.phpt b/ext/date/tests/timezone_location_get.phpt new file mode 100644 index 0000000000..745fc8799e --- /dev/null +++ b/ext/date/tests/timezone_location_get.phpt @@ -0,0 +1,24 @@ +--TEST-- +timezone_location_get: Test that timezone_location_get returns a correct array of information +--CREDITS-- +Havard Eide +#PHPTestFest2009 Norway 2009-06-09 \o/ +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECT-- +array(4) { + ["country_code"]=> + string(2) "NO" + ["latitude"]=> + float(59.91666) + ["longitude"]=> + float(10.75) + ["comments"]=> + string(0) "" +} + 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 +#testfest PHPSP on 2009-06-20 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--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 +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: imagerectangle() expects exactly 6 parameters, %d given in %s 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 index 0000000000..a177f54578 --- /dev/null +++ b/ext/posix/tests/posix_ctermid_error.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test function posix_ctermid() by calling it more than or less than its expected arguments +--SKIPIF-- + +--CREDITS-- +Marco Fabbri mrfabbri@gmail.com +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- + +--EXPECTF-- +Warning: posix_ctermid() expects exactly 0 parameters, 1 given in %s 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 index 0000000000..0a77fb0009 --- /dev/null +++ b/ext/posix/tests/posix_errno_error.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test function posix_errno() by calling it with its expected arguments +--SKIPIF-- + +--CREDITS-- +Morten Amundsen mor10am@gmail.com +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- + +--EXPECTF-- +*** Test by calling method or function with more than expected arguments *** + +Warning: posix_errno() expects exactly 0 parameters, 1 given in %s 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 index 0000000000..ac4e0d5ddc --- /dev/null +++ b/ext/posix/tests/posix_geteuid_error1.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test function posix_geteuid() by calling it more than or less than its expected arguments +--SKIPIF-- + +--CREDITS-- +Marco Fabbri mrfabbri@gmail.com +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--FILE-- + '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: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d +NULL diff --git a/ext/spl/tests/splDoublyLinkedList_shift_noParams.phpt b/ext/spl/tests/splDoublyLinkedList_shift_noParams.phpt new file mode 100644 index 0000000000..cd4ea5b033 --- /dev/null +++ b/ext/spl/tests/splDoublyLinkedList_shift_noParams.phpt @@ -0,0 +1,15 @@ +--TEST-- +Checks that the shift() method of DoublyLinkedList does not accept args. +--CREDITS-- +PHPNW Test Fest 2009 - Rick Ogden +--FILE-- +push(1); +$ll->push(2); + +var_dump($ll->shift(1)); +?> +--EXPECTF-- +Warning: SplDoublyLinkedList::shift() expects exactly 0 parameters, 1 given in %s on line %d +NULL diff --git a/ext/spl/tests/spldoublylinkedlist_offsetunset_first.phpt b/ext/spl/tests/spldoublylinkedlist_offsetunset_first.phpt new file mode 100644 index 0000000000..4dce4db8de --- /dev/null +++ b/ext/spl/tests/spldoublylinkedlist_offsetunset_first.phpt @@ -0,0 +1,25 @@ +--TEST-- +SPL: SplDoublyLinkedList : offsetUnset - first element +--CREDITS-- +PHPNW TestFest2009 - Rowan Merewood +--FILE-- +push('oh'); +$list->push('hai'); +$list->push('thar'); +$list->offsetUnset(0); +var_dump($list); +?> +--EXPECTF-- +object(SplDoublyLinkedList)#1 (2) { + [%u|b%"flags":%u|b%"SplDoublyLinkedList":private]=> + int(0) + [%u|b%"dllist":%u|b%"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + %string|unicode%(3) "hai" + [1]=> + %string|unicode%(4) "thar" + } +} diff --git a/ext/spl/tests/spldoublylinkedlist_offsetunset_first002.phpt b/ext/spl/tests/spldoublylinkedlist_offsetunset_first002.phpt new file mode 100644 index 0000000000..a42e6f9040 --- /dev/null +++ b/ext/spl/tests/spldoublylinkedlist_offsetunset_first002.phpt @@ -0,0 +1,17 @@ +--TEST-- +SPL: SplDoublyLinkedList : offsetUnset - first element +--CREDITS-- +PHPNW TestFest2009 - Rowan Merewood +--FILE-- +push('oh'); +$list->push('hai'); +$list->push('thar'); +echo $list->bottom() . "\n"; +$list->offsetUnset(0); +echo $list->bottom() . "\n"; +?> +--EXPECT-- +oh +hai diff --git a/ext/spl/tests/spldoublylinkedlist_offsetunset_last.phpt b/ext/spl/tests/spldoublylinkedlist_offsetunset_last.phpt new file mode 100644 index 0000000000..0f5dac19f9 --- /dev/null +++ b/ext/spl/tests/spldoublylinkedlist_offsetunset_last.phpt @@ -0,0 +1,25 @@ +--TEST-- +SPL: SplDoublyLinkedList : offsetUnset - last element +--CREDITS-- +PHPNW TestFest2009 - Rowan Merewood +--FILE-- +push('oh'); +$list->push('hai'); +$list->push('thar'); +$list->offsetUnset(2); +var_dump($list); +?> +--EXPECTF-- +object(SplDoublyLinkedList)#1 (2) { + [%u|b%"flags":%u|b%"SplDoublyLinkedList":private]=> + int(0) + [%u|b%"dllist":%u|b%"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + %string|unicode%(2) "oh" + [1]=> + %string|unicode%(3) "hai" + } +} diff --git a/ext/spl/tests/splfixedarray_offsetExists_larger.phpt b/ext/spl/tests/splfixedarray_offsetExists_larger.phpt new file mode 100644 index 0000000000..9449d64d8d --- /dev/null +++ b/ext/spl/tests/splfixedarray_offsetExists_larger.phpt @@ -0,0 +1,15 @@ +--TEST-- +Checks that offsetExists() does not accept a value larger than the array. +--CREDITS-- + PHPNW Test Fest 2009 - Rick Ogden +--FILE-- +offsetExists(4)); +?> +--EXPECT-- +bool(false) diff --git a/ext/standard/tests/array/key_exists_error.phpt b/ext/standard/tests/array/key_exists_error.phpt new file mode 100644 index 0000000000..1bbd41e20e --- /dev/null +++ b/ext/standard/tests/array/key_exists_error.phpt @@ -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-- + 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: key_exists() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: key_exists() expects exactly 2 parameters, 3 given in %s 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 index 0000000000..1c319bf790 --- /dev/null +++ b/ext/standard/tests/general_functions/get_cfg_var_error.phpt @@ -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-- + +--EXPECTF-- +*** Test by calling method or function with incorrect numbers of arguments *** + +Warning: get_cfg_var() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: get_cfg_var() expects exactly 1 parameter, 0 given in %s 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 index 0000000000..eaeec64888 --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyname_error.phpt @@ -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-- + +--EXPECTF-- +Warning: getservbyname() expects exactly 2 parameters, %d given in %s on line %d +NULL + +Warning: getservbyname() expects exactly 2 parameters, %d given in %s 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 index 0000000000..e2c245b7ea --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyport_error.phpt @@ -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-- + +--EXPECTF-- +Warning: getservbyport() expects exactly 2 parameters, %d given in %s on line %d +NULL + +Warning: getservbyport() expects exactly 2 parameters, %d given in %s on line %d +NULL