cvs: php-src /ext/spl/tests DirectoryIterator_getBasename_basic_test.phpt DirectoryIterator_getBasename_pass_array.phpt SplArray_fromArray.phpt
SplDoublyLinkedList_bottom_pass_array.phpt SplDoublyLinkedList_bottom_pass_float.phpt SplDoublyLinkedList_bottom_pass_integer.phpt
SplDoublyLinkedList_bottom_pass_null.phpt SplDoublyLinkedList_count.phpt SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt
SplDoublyLinkedList_current.phpt SplDoublyLinkedList_current_empty.phpt SplDoublyLinkedList_debug-info.phpt SplDoublyLinkedList_getIteratorMode.phpt
SplDoublyLinkedList_getIteratorMode_error.phpt SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt SplDoublyLinkedList_isEmpty_empty.phpt
SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt SplDoublyLinkedList_isEmpty_not-empty.phpt SplDoublyLinkedList_lifoMode.phpt
SplDoublyLinkedList_offsetExists_invalid_parameter.phpt SplDoublyLinkedList_offsetExists_success.phpt SplDoublyLinkedList_offsetGet_empty.phpt
SplDoubl! yLinkedList_offsetGet_missing_param.phpt SplDoublyLinkedList_offsetGet_param_array.phpt SplDoublyLinkedList_offsetGet_param_string.phpt
SplDoublyLinkedList_offsetSet_invalid_parameter.phpt SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt
SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt SplDoublyLinkedList_offsetUnset_negative-parameter.phpt
SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt SplDoublyLinkedList_pop_noParams.phpt SplDoublyLinkedList_pop_params.phpt
SplDoublyLinkedList_push_missing_parameter.phpt SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt
SplDoublyLinkedList_shift_noParams.phpt SplDoublyLinkedList_top_pass_array.phpt SplDoublyLinkedList_top_pass_float.phpt
SplDoublyLinkedList_top_pass_integer.phpt SplDoublyLinkedList_top_pass_null.phpt SplDoublyLinkedList_unshift_missing_parameter.phpt
SplDoublylinkedlist_offsetunset_first.phpt SplDoublylinkedlist_offsetunset_first002.phpt SplDoublylinkedlist_offsetunse! t_last.phpt
SplFixedArray__construct_param_array.phpt SplFixedArray__construct_param_float.phpt SplFixedArray__construct_param_null.phpt
SplFixedArray__construct_param_string.phpt SplFixedArray_construct_param_SplFixedArray.phpt SplFixedArray_count_checkParams.phpt
SplFixedArray_count_param_int.phpt SplFixedArray_current_par
| From: | Felipe Pena | Date: | Sat, 23 May 2009 15:37:37 +0000 |
| Subject: | cvs: php-src /ext/spl/tests DirectoryIterator_getBasename_basic_test.phpt DirectoryIterator_getBasename_pass_array.phpt SplArray_fromArray.phpt SplDoublyLinkedList_bottom_pass_array.phpt SplDoublyLinkedList_bottom_pass_float.phpt SplDoublyLinkedList_bottom_pass_integer.phpt SplDoublyLinkedList_bottom_pass_null.phpt SplDoublyLinkedList_count.phpt SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt SplDoublyLinkedList_current.phpt SplDoublyLinkedList_current_empty.phpt SplDoublyLinkedList_debug-info.phpt SplDoublyLinkedList_getIteratorMode.phpt SplDoublyLinkedList_getIteratorMode_error.phpt SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt SplDoublyLinkedList_isEmpty_empty.phpt SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt SplDoublyLinkedList_isEmpty_not-empty.phpt SplDoublyLinkedList_lifoMode.phpt SplDoublyLinkedList_offsetExists_invalid_parameter.phpt SplDoublyLinkedList_offsetExists_success.phpt SplDoublyLinkedList_offsetGet_empty.phpt SplDoubl! yLinkedList_offsetGet_missing_param.phpt SplDoublyLinkedList_offsetGet_param_array.phpt SplDoublyLinkedList_offsetGet_param_string.phpt SplDoublyLinkedList_offsetSet_invalid_parameter.phpt SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt SplDoublyLinkedList_offsetUnset_negative-parameter.phpt SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt SplDoublyLinkedList_pop_noParams.phpt SplDoublyLinkedList_pop_params.phpt SplDoublyLinkedList_push_missing_parameter.phpt SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt SplDoublyLinkedList_shift_noParams.phpt SplDoublyLinkedList_top_pass_array.phpt SplDoublyLinkedList_top_pass_float.phpt SplDoublyLinkedList_top_pass_integer.phpt SplDoublyLinkedList_top_pass_null.phpt SplDoublyLinkedList_unshift_missing_parameter.phpt SplDoublylinkedlist_offsetunset_first.phpt SplDoublylinkedlist_offsetunset_first002.phpt SplDoublylinkedlist_offsetunse! t_last.phpt SplFixedArray__construct_param_array.phpt SplFixedArray__construct_param_float.phpt SplFixedArray__construct_param_null.phpt SplFixedArray__construct_param_string.phpt SplFixedArray_construct_param_SplFixedArray.phpt SplFixedArray_count_checkParams.phpt SplFixedArray_count_param_int.phpt SplFixedArray_current_par |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-58141@lists.php.net to get a copy of this message | ||
felipe Sat May 23 15:37:37 2009 UTC
Added files:
/php-src/ext/spl/tests
DirectoryIterator_getBasename_basic_test.phpt
DirectoryIterator_getBasename_pass_array.phpt
SplArray_fromArray.phpt
SplDoublyLinkedList_bottom_pass_array.phpt
SplDoublyLinkedList_bottom_pass_float.phpt
SplDoublyLinkedList_bottom_pass_integer.phpt
SplDoublyLinkedList_bottom_pass_null.phpt
SplDoublyLinkedList_count.phpt
SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt
SplDoublyLinkedList_current.phpt
SplDoublyLinkedList_current_empty.phpt
SplDoublyLinkedList_debug-info.phpt
SplDoublyLinkedList_getIteratorMode.phpt
SplDoublyLinkedList_getIteratorMode_error.phpt
SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt
SplDoublyLinkedList_isEmpty_empty.phpt
SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt
SplDoublyLinkedList_isEmpty_not-empty.phpt
SplDoublyLinkedList_lifoMode.phpt
SplDoublyLinkedList_offsetExists_invalid_parameter.phpt
SplDoublyLinkedList_offsetExists_success.phpt
SplDoublyLinkedList_offsetGet_empty.phpt
SplDoublyLinkedList_offsetGet_missing_param.phpt
SplDoublyLinkedList_offsetGet_param_array.phpt
SplDoublyLinkedList_offsetGet_param_string.phpt
SplDoublyLinkedList_offsetSet_invalid_parameter.phpt
SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt
SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt
SplDoublyLinkedList_offsetUnset_negative-parameter.phpt
SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt
SplDoublyLinkedList_pop_noParams.phpt
SplDoublyLinkedList_pop_params.phpt
SplDoublyLinkedList_push_missing_parameter.phpt
SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt
SplDoublyLinkedList_shift_noParams.phpt
SplDoublyLinkedList_top_pass_array.phpt
SplDoublyLinkedList_top_pass_float.phpt
SplDoublyLinkedList_top_pass_integer.phpt
SplDoublyLinkedList_top_pass_null.phpt
SplDoublyLinkedList_unshift_missing_parameter.phpt
SplDoublylinkedlist_offsetunset_first.phpt
SplDoublylinkedlist_offsetunset_first002.phpt
SplDoublylinkedlist_offsetunset_last.phpt
SplFixedArray__construct_param_array.phpt
SplFixedArray__construct_param_float.phpt
SplFixedArray__construct_param_null.phpt
SplFixedArray__construct_param_string.phpt
SplFixedArray_construct_param_SplFixedArray.phpt
SplFixedArray_count_checkParams.phpt
SplFixedArray_count_param_int.phpt
SplFixedArray_current_param.phpt
SplFixedArray_fromArray_invalid_parameter_001.phpt
SplFixedArray_fromArray_invalid_parameter_002.phpt
SplFixedArray_fromarray_indexes.phpt
SplFixedArray_fromarray_non_indexes.phpt
SplFixedArray_fromarray_param_boolean.phpt
SplFixedArray_fromarray_param_multiarray.phpt
SplFixedArray_getSize_pass_param.phpt
SplFixedArray_key_param.phpt
SplFixedArray_key_setsize.phpt
SplFixedArray_next_param.phpt
SplFixedArray_offsetExists_invalid_parameter.phpt
SplFixedArray_offsetExists_less_than_zero.phpt
SplFixedArray_offsetGet_invalid_parameter.phpt
SplFixedArray_offsetSet_invalid_parameter.phpt
SplFixedArray_offsetSet_one_invalid_parameter.phpt
SplFixedArray_offsetUnset_invalid_parameter.phpt
SplFixedArray_offsetUnset_string.phpt
SplFixedArray_rewind_param.phpt
SplFixedArray_setSize_filled_to_smaller.phpt
SplFixedArray_setSize_param_array.phpt
SplFixedArray_setSize_param_float.phpt
SplFixedArray_setSize_param_null.phpt
SplFixedArray_setSize_reduce.phpt
SplFixedArray_setsize_001.phpt
SplFixedArray_setsize_grow.phpt
SplFixedArray_setsize_shrink.phpt
SplFixedArray_toArray_with-params.phpt
SplFixedarray_offsetExists_larger.phpt
SplHeap_count_invalid_parameter.phpt
SplHeap_extract_invalid_parameter.phpt
SplHeap_insert_invalid_parameter.phpt
SplHeap_isEmpty.phpt
SplHeap_isEmpty_invalid_parameter.phpt
SplObjectStorage_addAll_invalid_parameter.phpt
SplObjectStorage_attach_invalid_parameter.phpt
SplObjectStorage_contains_invalid_parameter.phpt
SplObjectStorage_current_empty_storage.phpt
SplObjectStorage_detach_invalid_parameter.phpt
SplObjectStorage_getInfo_empty_storage.phpt
SplObjectStorage_offsetGet.phpt
SplObjectStorage_offsetGet_invalid_parameter.phpt
SplObjectStorage_offsetGet_missing_object.phpt
SplObjectStorage_removeAll_invalid_parameter.phpt
SplObjectStorage_setInfo_empty_storage.phpt
SplObjectStorage_setInfo_invalid_parameter.phpt
SplObjectStorage_unserialize_invalid_parameter1.phpt
SplObjectStorage_unserialize_invalid_parameter2.phpt
SplObjectStorage_unserialize_invalid_parameter3.phpt
SplPriorityQueue_extract_invalid_parameter.phpt
SplPriorityQueue_insert_invalid_parameter.phpt
SplQueue_setIteratorMode.phpt
SplQueue_setIteratorMode_param_lifo.phpt
SplStack_setIteratorMode.phpt
Log:
- New tests (testfest NorthWestUG)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt +++ php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt --TEST-- DirectoryIterator::getBasename() - Basic Test --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); mkdir($targetDir); touch($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); $dir = new DirectoryIterator($targetDir.DIRECTORY_SEPARATOR); while(!$dir->isFile()) { $dir->next(); } echo $dir->getBasename('.txt'); ?> --CLEAN-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); unlink($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); rmdir($targetDir); ?> --EXPECTF-- getBasename_test http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt +++ php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt --TEST-- DirectoryIterator::getBasename() - Pass unexpected array --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); mkdir($targetDir); touch($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); $dir = new DirectoryIterator($targetDir.DIRECTORY_SEPARATOR); while(!$dir->isFile()) { $dir->next(); } echo $dir->getBasename(array()); ?> --CLEAN-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); unlink($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); rmdir($targetDir); ?> --EXPECTF-- Warning: DirectoryIterator::getBasename() expects parameter 1 to be %binary_string_optional%, array given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplArray_fromArray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplArray_fromArray.phpt +++ php-src/ext/spl/tests/SplArray_fromArray.phpt --TEST-- Check that SplArray::fromArray will not allow integer overflows --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $array = array(PHP_INT_MAX => 'foo'); $splArray = new SplFixedArray(); try { $splArray->fromArray($array); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- integer overflow detected http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected array parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(array()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected float parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(3.14159); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected integer parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(45); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(null); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt --TEST-- Check that SplDoublyLinkedList::count fails if parameter passed in --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $list = new SplDoublyLinkedList(); $c = $list->count('foo'); ?> --EXPECTF-- Warning: SplDoublyLinkedList::count() expects exactly 0 parameters, 1 given in %s on line 4 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt --TEST-- Create a SplDoublyLinkedList, call count() and pass a SplDoublyLinkedList object as the parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $dll = new SplDoublyLinkedList(2); $dll->count(new SplDoublyLinkedList(2)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt --TEST-- SplDoublyLinkedList getIteratorMode --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); var_dump($list->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt --TEST-- Run current() function on an empty SplDoublyLinkedList. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $list = new SplDoublyLinkedList(); var_dump($list->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt --TEST-- Check that SplDoublyLinkedList returns debug info when print_r is used. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); // Check the debug info print_r($dll); ?> --EXPECT-- SplDoublyLinkedList Object ( [flags:SplDoublyLinkedList:private] => 0 [dllist:SplDoublyLinkedList:private] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt --TEST-- SplDoublyLinkedList getIteratorMode --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP); echo $list->getIteratorMode(); ?> --EXPECT-- 0 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt --TEST-- SplDoublyLinkedList getIteratorMode with an unexpected parameter --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); $list->getIteratorMode(24); ?> --EXPECTF-- Warning: SplDoublyLinkedList::getIteratorMode() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() returns an error message when a parameter is passed. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); var_dump($dll->isEmpty("test")); ?> --EXPECTF-- Warning: SplDoublyLinkedList::isEmpty() expects exactly 0 parameters, %d given in %s NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() correctly returns true for an empty list. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); var_dump($dll->isEmpty()); ?> --EXPECT-- bool(true) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() returns an error message when a parameter is passed. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); //var_dump($dll); var_dump($dll->isEmpty("test")); ?> --EXPECTF-- Warning: SplDoublyLinkedList::isEmpty() expects exactly 0 parameters, %d given in %s NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() correctly returns true for a non-empty list. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); //var_dump($dll); var_dump($dll->isEmpty()); ?> --EXPECT-- bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt --TEST-- Check that SplDoublyLinkedList can traverse backwards --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push('o'); $list->push('o'); $list->push('f'); $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); $list->rewind(); while ($tmp = $list->current()) { echo $tmp; $list->next(); } ?> --EXPECT-- foo http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt --TEST-- SPL SplDoublyLinkedList offsetExists displays warning and returns null on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetExists(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetExists() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt --TEST-- SPL SplDoublyLinkedList offsetExists returns correct values --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); // Push two values onto the list $list->push('abc'); $list->push('def'); // Validate that we can see the first value if($list->offsetExists(0) === true) { echo "PASS\n"; } // Validate that we can see the second value if($list->offsetExists(1) === true) { echo "PASS\n"; } // Check that there is no third value if($list->offsetExists(2) === false) { echo "PASS\n"; } ?> --EXPECTF-- PASS PASS PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt --TEST-- SplDoublyLinkedList::offsetGet() with no parameter passed. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet(); ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt --TEST-- Tests that the offsetGet() method throws an error when no argument is sent --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $dll = new SplDoublyLinkedList(); $dll->push(1); $dll->push(2); var_dump($dll->offsetGet()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt --TEST-- SplDoublyLinkedList::offsetGet() with 1st parameter passed as array. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet( array( 'fail' ) ); ?> --EXPECTF-- Fatal error: Uncaught exception 'OutOfRangeException' with message 'Offset invalid or out of range' in %s Stack trace: #0 %s #1 {main} thrown in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt --TEST-- SplDoublyLinkedList::offsetGet() with 1st parameter passed as string. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet( 'fail' ); ?> --EXPECTF-- Fatal error: Uncaught exception 'OutOfRangeException' with message 'Offset invalid or out of range' in %s Stack trace: #0 %s #1 {main} thrown in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt --TEST-- SplDoublyLinkedList offsetSet throws error on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetSet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetSet() expects exactly 2 parameters, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt --TEST-- SplDoublyLinkedList offsetSet throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetSet(2); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetSet() expects exactly 2 parameters, 1 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt --TEST-- Doubly Linked List - offsetUnset > number elements --CREDITS-- PHPNW Test Fest 2009 - Mat Griffin --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->push('1'); $ll->push('2'); $ll->push('3'); try { $ll->offsetUnset($ll->count() + 1); var_dump($ll); } catch(Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt --TEST-- Check that SplDoublyLinkedList->offsetUnset() returns an error message when the offset is < 0. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); try { $dll->offsetUnset(-1); } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt --TEST-- Check that SplDoublyLinkedList->offsetUnset() returns an error message when the offset is > elements. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); try { $dll->offsetUnset(3); } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt --TEST-- Checks that the pop() method of DoublyLinkedList does not accept args. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->push(1); $ll->push(2); var_dump($ll->pop(1)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::pop() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt --TEST-- SplDoublyLinkedList::offsetGet() with no parameter passed. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->pop( 'param' ); ?> --EXPECTF-- Warning: SplDoublyLinkedList::pop() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt --TEST-- Check that SplDoublyLinkedList::push generate a warning and return NULL with missing param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $dll = new SplDoublyLinkedList(); var_dump($dll->push()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::push() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt --TEST-- Create a SplDoublyLinkedList, call setIteratorMode() and pass a SplDoublyLinkedList object as the parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $dll = new SplDoublyLinkedList(2); $dll->setIteratorMode(new SplDoublyLinkedList(2)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::setIteratorMode() expects parameter 1 to be long, object given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt --TEST-- Checks that the shift() method of DoublyLinkedList does not accept args. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->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 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected array --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(array()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected float parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(3.14159); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected integer parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(45); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(null); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt --TEST-- Check that SplDoublyLinkedList::unshift generate a warning and return NULL with missing param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $dll = new SplDoublyLinkedList(); var_dump($dll->unshift()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::unshift() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - first element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->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" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - first element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push('oh'); $list->push('hai'); $list->push('thar'); echo $list->bottom() . "\n"; $list->offsetUnset(0); echo $list->bottom() . "\n"; ?> --EXPECT-- oh hai http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - last element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->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" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt --TEST-- SplFixedArray::__construct() with array passed as integer. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( array("string", 1) ); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, array given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt --TEST-- SplFixedArray::__construct() with float passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3.141 ); echo $array->getSize(); ?> --EXPECT-- 3 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt --TEST-- SplFixedArray::__construct() with null passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( NULL ); print_r( $array ); ?> --EXPECTF-- SplFixedArray Object ( ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt --TEST-- SplFixedArray::__construct() with string passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( "string" ); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt +++ php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt --TEST-- Create an SplFixedArray using an SplFixedArray object. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(new SplFixedArray(3)); var_dump($array); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, object given in %s on line %d object(SplFixedArray)#1 (0) { } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt +++ php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt --TEST-- Makes sure that an integer cannot be passed into the count() method of the splFixedArray. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ar = new SplFixedArray(3); $ar[0] = 1; $ar[1] = 2; $ar[2] = 3; echo $ar->count(3); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt +++ php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt --TEST-- Creates array, uses the count function to get the size of the array, but passes a parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(5); echo $array->count(3); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_current_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_current_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_current_param.phpt --TEST-- SplFixedArray::current() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->current( array("this","should","not","execute") ); } ?> --EXPECTF-- Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt --TEST-- pass an integer into fromArray() --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php echo SplFixedArray::fromArray(17954); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, integer given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt --TEST-- pass a string into fromArray() --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php echo SplFixedArray::fromArray('hello'); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, %unicode_string_optional% given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt --TEST-- Create a SplFixedArray from an array using the fromArray() function use the default behaviour of preserve the indexes. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(1 => 1, 2 => '2', 3 => false)); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (4) { [0]=> NULL [1]=> int(1) [2]=> %string|unicode%(1) "2" [3]=> bool(false) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt --TEST-- Create a SplFixedArray from an array using the fromArray() function don't try to preserve the indexes. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(1 => 1, 2 => '2', 3 => false), false); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (3) { [0]=> int(1) [1]=> %string|unicode%(1) "2" [2]=> bool(false) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt --TEST-- Tries to create a SplFixedArray using a boolean value. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(true); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, boolean given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt --TEST-- Tries to create a SplFixedArray using the fromArray() function and a multi dimentional array. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(array('1'))); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (1) { [0]=> array(1) { [0]=> %string|unicode%(1) "1" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt --TEST-- SplFixedArray::getSize() pass a parameter when none are expected --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); echo "*test* ".$fixed_array->getSize(3); ?> --EXPECTF-- Warning: SplFixedArray::getSize() expects exactly 0 parameters, 1 given in %s on line %d *test* http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_key_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_key_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_key_param.phpt --TEST-- SplFixedArray::key() with a parameter passed. This is a bug and an error should be called. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->key( array("this","should","not","execute") ); } ?> --EXPECTF-- Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt +++ php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt --TEST-- SplFixedArray::key() when the array has a size higher than the amount of values specified. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->key( ); } ?> --EXPECT-- 0123 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_next_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_next_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_next_param.phpt --TEST-- SplFixedArray::next() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; $array->next( "invalid" ); ?> --EXPECTF-- Warning: SplFixedArray::next() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt --TEST-- SPL FixedArray offsetExists throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetExists(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetExists() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt --TEST-- SPL FixedArray offsetExists behaviour on a negative index --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); if($array->offsetExists(-10) === false) { echo 'PASS'; } ?> --EXPECT-- PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt --TEST-- SPL FixedArray offsetGet throws error on no parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'a'; $a = $array->offsetGet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt --TEST-- SPL FixedArray offsetSet throws error on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetSet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetSet() expects exactly 2 parameters, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt --TEST-- SPL FixedArray offsetSet throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetSet(2); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetSet() expects exactly 2 parameters, 1 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt --TEST-- SPL FixedArray offsetUnset throws error on no parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetUnset(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetUnset() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt --TEST-- Check removing an item from an array when the offset is not an integer. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a fixed array $fixedArray = new SplFixedArray(5); // Fill it up for ($i=0; $i < 5; $i++) { $fixedArray[$i] = "PHPNW Testfest"; } // remove an item $fixedArray->offsetUnset("4"); var_dump($fixedArray); ?> --EXPECTF-- object(SplFixedArray)#1 (5) { [0]=> %string|unicode%(14) "PHPNW Testfest" [1]=> %string|unicode%(14) "PHPNW Testfest" [2]=> %string|unicode%(14) "PHPNW Testfest" [3]=> %string|unicode%(14) "PHPNW Testfest" [4]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt --TEST-- SplFixedArray::rewind() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; $array->rewind( "invalid" ); ?> --EXPECTF-- Warning: SplFixedArray::rewind() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt --TEST-- Create array, fills it with and resizes it to lower value. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 1; $array[1] = 1; $array[2] = 1; $array[3] = 1; $array[4] = 1; $array->setSize(2); var_dump($array); ?> --EXPECT-- object(SplFixedArray)#1 (2) { [0]=> int(1) [1]=> int(1) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt --TEST-- SplFixedArray::setSize() with an array parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(array()); var_dump($fixed_array); ?> --EXPECTF-- Warning: SplFixedArray::setSize() expects parameter 1 to be long, array given in %s on line %d object(SplFixedArray)#1 (2) { [0]=> NULL [1]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt --TEST-- SplFixedArray::setSize() with a float param --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(3.14159); var_dump($fixed_array); ?> --EXPECTF-- object(SplFixedArray)#1 (3) { [0]=> NULL [1]=> NULL [2]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt --TEST-- SplFixedArray::setSize() with a null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(null); var_dump($fixed_array); ?> --EXPECT-- object(SplFixedArray)#1 (0) { } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt --TEST-- SPL FixedArray can reduce size of array --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'a'; $array[1] = 'b'; $array[2] = 'c'; $array[3] = 'd'; $array[4] = 'e'; $array->setSize(3); print_r($array); ?> --EXPECT-- SplFixedArray Object ( [0] => a [1] => b [2] => c ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt --TEST-- SPL: FixedArray: setsize - populate array, then shrink --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'one'; $array[1] = 'two'; $array[2] = 'three'; $array[3] = 'four'; $array[4] = 'five'; $array->setSize(2); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (2) { [0]=> %string|unicode%(3) "one" [1]=> %string|unicode%(3) "two" } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt --TEST-- SplFixedArray::setSize() grow --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php echo "\n"; $array = new SplFixedArray(2); $array[0] = "Value 1"; $array[1] = "Value 2"; $array->setSize(4); $array[2] = "Value 3"; $array[3] = "Value 4"; print_r($array); ?> --EXPECT-- SplFixedArray Object ( [0] => Value 1 [1] => Value 2 [2] => Value 3 [3] => Value 4 ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt --TEST-- shrink a full array of integers --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 1; $array[1] = 1; $array[2] = 1; $array[3] = 1; $array[4] = 1; $array->setSize(4); var_dump($array); ?> --EXPECT-- object(SplFixedArray)#1 (4) { [0]=> int(1) [1]=> int(1) [2]=> int(1) [3]=> int(1) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt +++ php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt --TEST-- Check that passing a parameter to toArray() produces a correct error --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a fixed array $fixedArray = new SplFixedArray(5); // Fill it up for ($i=0; $i < 5; $i++) { $fixedArray[$i] = "PHPNW Testfest"; } // Test count() returns correct error when parameters are passed. $fixedArray->count(1); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, %d given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt +++ php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt --TEST-- Checks that offsetExists() does not accept a value larger than the array. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ar = new SplFixedArray(3); $ar[0] = 1; $ar[1] = 2; $ar[2] = 3; var_dump($ar->offsetExists(4)); ?> --EXPECT-- bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt --TEST-- Check that SplHeap::count generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->count($input)); } ?> --EXPECTF-- Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt --TEST-- Check that SplHeap::extract generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->extract($input)); } ?> --EXPECTF-- Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt --TEST-- Check that SplHeap::insert generate a warning and returns NULL when $value is missing --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplMaxHeap(); var_dump($h->insert()); ?> --EXPECTF-- Warning: SplHeap::insert() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_isEmpty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_isEmpty.phpt +++ php-src/ext/spl/tests/SplHeap_isEmpty.phpt --TEST-- Check that SplHeap::isEmpty standard success test --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplMaxHeap(); var_dump($h->isEmpty()); ?> --EXPECTF-- bool(true) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt --TEST-- Check that SplHeap::isEmpty generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->isEmpty($input)); } ?> --EXPECTF-- Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::addAll generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->addAll($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, double given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::attach generates a warning and returns NULL when bad params are passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->attach(true)); var_dump($s->attach(new stdClass, true, true)); ?> --EXPECTF-- Warning: SplObjectStorage::attach() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::attach() expects at most 2 parameters, 3 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::contains generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->contains($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::contains() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt --TEST-- Check that SplObjectStorage::current returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::detach generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->detach($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::detach() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt --TEST-- Check that SplObjectStorage::getInfo returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->getInfo()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt --TEST-- Standard success for SplObjectStorage::offsetGet --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); $o1 = new stdClass(); $s[$o1] = 'some_value'; echo $s->offsetGet($o1); ?> --EXPECT-- some_value http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::offsetGet generate a warning and return NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); $o1 = new stdClass(); $s[$o1] = 'some_value'; var_dump($s->offsetGet($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt --TEST-- Check that SplObjectStorage::offsetGet throws exception when non-existing object is requested --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); $o1 = new stdClass(); try { $s->offsetGet($o1); } catch (UnexpectedValueException $e) { echo $e->getMessage(); } ?> --EXPECT-- Object not found http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::removeAll generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->removeAll($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, double given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt --TEST-- Check that SplObjectStorage::setInfo returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->setInfo('some_value')); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::setInfo returns NULL when no param is passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->setInfo()); ?> --EXPECTF-- Warning: SplObjectStorage::setInfo() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt --TEST-- Check that SplObjectStorage::unserialize returns NULL when non-string param is passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), new stdClass(), ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->unserialize($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::unserialize() expects parameter 1 to be %binary_string_optional%, array given in %s on line %d NULL Warning: SplObjectStorage::unserialize() expects parameter 1 to be %binary_string_optional%, object given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt --TEST-- Check that SplObjectStorage::unserialize throws exception when numeric value passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( 12345, 1.2345, PHP_INT_MAX, 'x:rubbish', // rubbish after the 'x:' prefix 'x:i:2;O:8:"stdClass":0:{},s:5:"value";;m:a:0:{}', ); foreach($data_provider as $input) { $s = new SplObjectStorage(); try { $s->unserialize($input); } catch(UnexpectedValueException $e) { echo $e->getMessage() . PHP_EOL; } } ?> --EXPECTF-- Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt --TEST-- Check that SplObjectStorage::unserialize throws exception when NULL passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); try { $s->unserialize(NULL); } catch(UnexpectedValueException $e) { echo $e->getMessage(); } ?> --EXPECTF-- Empty serialized string cannot be empty http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt --TEST-- Check that SplPriorityQueue::extract generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplPriorityQueue(); var_dump($h->extract($input)); } ?> --EXPECTF-- Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt --TEST-- Check that SplPriorityQueue::insert generate a warning and returns NULL when rubbish params are passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplPriorityQueue(); var_dump($h->insert(NULL)); ?> --EXPECTF-- Warning: SplPriorityQueue::insert() expects exactly 2 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt +++ php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt --TEST-- Check that SplQueue can't be set to LIFO --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $queue = new SplQueue(); try { $queue->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECTF-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt +++ php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt --TEST-- SplQueue setIteratorMode to LIFO produces fail condition in try/catch --CREDITS-- PHPNW Test Fest 2009 - Jeremy Coates jeremy@phpnw.org.uk --FILE-- <?php try { $dll = new SplQueue(); $dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplStack_setIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplStack_setIteratorMode.phpt +++ php-src/ext/spl/tests/SplStack_setIteratorMode.phpt --TEST-- Check that SplStack can't be set to FIFO --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $stack = new SplStack(); try { $stack->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECTF-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt +++ php-src/ext/spl/tests/DirectoryIterator_getBasename_basic_test.phpt --TEST-- DirectoryIterator::getBasename() - Basic Test --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); mkdir($targetDir); touch($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); $dir = new DirectoryIterator($targetDir.DIRECTORY_SEPARATOR); while(!$dir->isFile()) { $dir->next(); } echo $dir->getBasename('.txt'); ?> --CLEAN-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); unlink($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); rmdir($targetDir); ?> --EXPECTF-- getBasename_test http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt +++ php-src/ext/spl/tests/DirectoryIterator_getBasename_pass_array.phpt --TEST-- DirectoryIterator::getBasename() - Pass unexpected array --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); mkdir($targetDir); touch($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); $dir = new DirectoryIterator($targetDir.DIRECTORY_SEPARATOR); while(!$dir->isFile()) { $dir->next(); } echo $dir->getBasename(array()); ?> --CLEAN-- <?php $targetDir = __DIR__.DIRECTORY_SEPARATOR.md5('directoryIterator::getbasename'); unlink($targetDir.DIRECTORY_SEPARATOR.'getBasename_test.txt'); rmdir($targetDir); ?> --EXPECTF-- Warning: DirectoryIterator::getBasename() expects parameter 1 to be %binary_string_optional%, array given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplArray_fromArray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplArray_fromArray.phpt +++ php-src/ext/spl/tests/SplArray_fromArray.phpt --TEST-- Check that SplArray::fromArray will not allow integer overflows --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $array = array(PHP_INT_MAX => 'foo'); $splArray = new SplFixedArray(); try { $splArray->fromArray($array); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- integer overflow detected http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_array.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected array parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(array()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_float.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected float parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(3.14159); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_integer.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected integer parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(45); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_bottom_pass_null.phpt --TEST-- SplDoublyLinkedList::bottom() - pass in an unexpected null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->bottom(null); ?> --EXPECTF-- Warning: SplDoublyLinkedList::bottom() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_count.phpt --TEST-- Check that SplDoublyLinkedList::count fails if parameter passed in --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $list = new SplDoublyLinkedList(); $c = $list->count('foo'); ?> --EXPECTF-- Warning: SplDoublyLinkedList::count() expects exactly 0 parameters, 1 given in %s on line 4 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_count_param_SplDoublyLinkedList.phpt --TEST-- Create a SplDoublyLinkedList, call count() and pass a SplDoublyLinkedList object as the parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $dll = new SplDoublyLinkedList(2); $dll->count(new SplDoublyLinkedList(2)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_current.phpt --TEST-- SplDoublyLinkedList getIteratorMode --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); var_dump($list->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_current_empty.phpt --TEST-- Run current() function on an empty SplDoublyLinkedList. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $list = new SplDoublyLinkedList(); var_dump($list->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_debug-info.phpt --TEST-- Check that SplDoublyLinkedList returns debug info when print_r is used. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); // Check the debug info print_r($dll); ?> --EXPECT-- SplDoublyLinkedList Object ( [flags:SplDoublyLinkedList:private] => 0 [dllist:SplDoublyLinkedList:private] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode.phpt --TEST-- SplDoublyLinkedList getIteratorMode --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP); echo $list->getIteratorMode(); ?> --EXPECT-- 0 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_getIteratorMode_error.phpt --TEST-- SplDoublyLinkedList getIteratorMode with an unexpected parameter --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $list = new SplDoublyLinkedList(); $list->getIteratorMode(24); ?> --EXPECTF-- Warning: SplDoublyLinkedList::getIteratorMode() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty-with-parameter.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() returns an error message when a parameter is passed. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); var_dump($dll->isEmpty("test")); ?> --EXPECTF-- Warning: SplDoublyLinkedList::isEmpty() expects exactly 0 parameters, %d given in %s NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_empty.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() correctly returns true for an empty list. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); var_dump($dll->isEmpty()); ?> --EXPECT-- bool(true) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() returns an error message when a parameter is passed. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); //var_dump($dll); var_dump($dll->isEmpty("test")); ?> --EXPECTF-- Warning: SplDoublyLinkedList::isEmpty() expects exactly 0 parameters, %d given in %s NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_isEmpty_not-empty.phpt --TEST-- Check that SplDoublyLinkedList->isEmpty() correctly returns true for a non-empty list. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); //var_dump($dll); var_dump($dll->isEmpty()); ?> --EXPECT-- bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt --TEST-- Check that SplDoublyLinkedList can traverse backwards --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push('o'); $list->push('o'); $list->push('f'); $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); $list->rewind(); while ($tmp = $list->current()) { echo $tmp; $list->next(); } ?> --EXPECT-- foo http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_invalid_parameter.phpt --TEST-- SPL SplDoublyLinkedList offsetExists displays warning and returns null on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetExists(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetExists() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetExists_success.phpt --TEST-- SPL SplDoublyLinkedList offsetExists returns correct values --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); // Push two values onto the list $list->push('abc'); $list->push('def'); // Validate that we can see the first value if($list->offsetExists(0) === true) { echo "PASS\n"; } // Validate that we can see the second value if($list->offsetExists(1) === true) { echo "PASS\n"; } // Check that there is no third value if($list->offsetExists(2) === false) { echo "PASS\n"; } ?> --EXPECTF-- PASS PASS PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_empty.phpt --TEST-- SplDoublyLinkedList::offsetGet() with no parameter passed. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet(); ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_missing_param.phpt --TEST-- Tests that the offsetGet() method throws an error when no argument is sent --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $dll = new SplDoublyLinkedList(); $dll->push(1); $dll->push(2); var_dump($dll->offsetGet()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt --TEST-- SplDoublyLinkedList::offsetGet() with 1st parameter passed as array. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet( array( 'fail' ) ); ?> --EXPECTF-- Fatal error: Uncaught exception 'OutOfRangeException' with message 'Offset invalid or out of range' in %s Stack trace: #0 %s #1 {main} thrown in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt --TEST-- SplDoublyLinkedList::offsetGet() with 1st parameter passed as string. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->offsetGet( 'fail' ); ?> --EXPECTF-- Fatal error: Uncaught exception 'OutOfRangeException' with message 'Offset invalid or out of range' in %s Stack trace: #0 %s #1 {main} thrown in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_invalid_parameter.phpt --TEST-- SplDoublyLinkedList offsetSet throws error on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetSet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetSet() expects exactly 2 parameters, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetSet_one_invalid_parameter.phpt --TEST-- SplDoublyLinkedList offsetSet throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $list = new SplDoublyLinkedList(); $a = $list->offsetSet(2); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplDoublyLinkedList::offsetSet() expects exactly 2 parameters, 1 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt --TEST-- Doubly Linked List - offsetUnset > number elements --CREDITS-- PHPNW Test Fest 2009 - Mat Griffin --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->push('1'); $ll->push('2'); $ll->push('3'); try { $ll->offsetUnset($ll->count() + 1); var_dump($ll); } catch(Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt --TEST-- Check that SplDoublyLinkedList->offsetUnset() returns an error message when the offset is < 0. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); try { $dll->offsetUnset(-1); } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt --TEST-- Check that SplDoublyLinkedList->offsetUnset() returns an error message when the offset is > elements. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a new Doubly Linked List $dll = new SplDoublyLinkedList(); // Add some items to the list $dll->push(1); $dll->push(2); $dll->push(3); try { $dll->offsetUnset(3); } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- Offset out of range http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_pop_noParams.phpt --TEST-- Checks that the pop() method of DoublyLinkedList does not accept args. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->push(1); $ll->push(2); var_dump($ll->pop(1)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::pop() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_pop_params.phpt --TEST-- SplDoublyLinkedList::offsetGet() with no parameter passed. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplDoublyLinkedList( ); $get = $array->pop( 'param' ); ?> --EXPECTF-- Warning: SplDoublyLinkedList::pop() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_push_missing_parameter.phpt --TEST-- Check that SplDoublyLinkedList::push generate a warning and return NULL with missing param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $dll = new SplDoublyLinkedList(); var_dump($dll->push()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::push() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.phpt --TEST-- Create a SplDoublyLinkedList, call setIteratorMode() and pass a SplDoublyLinkedList object as the parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $dll = new SplDoublyLinkedList(2); $dll->setIteratorMode(new SplDoublyLinkedList(2)); ?> --EXPECTF-- Warning: SplDoublyLinkedList::setIteratorMode() expects parameter 1 to be long, object given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_shift_noParams.phpt --TEST-- Checks that the shift() method of DoublyLinkedList does not accept args. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ll = new SplDoublyLinkedList(); $ll->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 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_array.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected array --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(array()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_float.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected float parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(3.14159); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_integer.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected integer parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(45); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_top_pass_null.phpt --TEST-- SplDoublyLinkedList::top() - pass in an unexpected null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push("top"); $list->top(null); ?> --EXPECTF-- Warning: SplDoublyLinkedList::top() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt +++ php-src/ext/spl/tests/SplDoublyLinkedList_unshift_missing_parameter.phpt --TEST-- Check that SplDoublyLinkedList::unshift generate a warning and return NULL with missing param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $dll = new SplDoublyLinkedList(); var_dump($dll->unshift()); ?> --EXPECTF-- Warning: SplDoublyLinkedList::unshift() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - first element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->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" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_first002.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - first element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->push('oh'); $list->push('hai'); $list->push('thar'); echo $list->bottom() . "\n"; $list->offsetUnset(0); echo $list->bottom() . "\n"; ?> --EXPECT-- oh hai http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt +++ php-src/ext/spl/tests/SplDoublylinkedlist_offsetunset_last.phpt --TEST-- SPL: SplDoublyLinkedList : offsetUnset - last element --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $list = new SplDoublyLinkedList(); $list->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" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_array.phpt --TEST-- SplFixedArray::__construct() with array passed as integer. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( array("string", 1) ); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, array given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_float.phpt --TEST-- SplFixedArray::__construct() with float passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3.141 ); echo $array->getSize(); ?> --EXPECT-- 3 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_null.phpt --TEST-- SplFixedArray::__construct() with null passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( NULL ); print_r( $array ); ?> --EXPECTF-- SplFixedArray Object ( ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt +++ php-src/ext/spl/tests/SplFixedArray__construct_param_string.phpt --TEST-- SplFixedArray::__construct() with string passed as parameter. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( "string" ); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt +++ php-src/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt --TEST-- Create an SplFixedArray using an SplFixedArray object. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(new SplFixedArray(3)); var_dump($array); ?> --EXPECTF-- Warning: SplFixedArray::__construct() expects parameter 1 to be long, object given in %s on line %d object(SplFixedArray)#1 (0) { } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt +++ php-src/ext/spl/tests/SplFixedArray_count_checkParams.phpt --TEST-- Makes sure that an integer cannot be passed into the count() method of the splFixedArray. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ar = new SplFixedArray(3); $ar[0] = 1; $ar[1] = 2; $ar[2] = 3; echo $ar->count(3); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt +++ php-src/ext/spl/tests/SplFixedArray_count_param_int.phpt --TEST-- Creates array, uses the count function to get the size of the array, but passes a parameter. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(5); echo $array->count(3); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_current_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_current_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_current_param.phpt --TEST-- SplFixedArray::current() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->current( array("this","should","not","execute") ); } ?> --EXPECTF-- Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::current() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_001.phpt --TEST-- pass an integer into fromArray() --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php echo SplFixedArray::fromArray(17954); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, integer given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromArray_invalid_parameter_002.phpt --TEST-- pass a string into fromArray() --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php echo SplFixedArray::fromArray('hello'); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, %unicode_string_optional% given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_indexes.phpt --TEST-- Create a SplFixedArray from an array using the fromArray() function use the default behaviour of preserve the indexes. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(1 => 1, 2 => '2', 3 => false)); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (4) { [0]=> NULL [1]=> int(1) [2]=> %string|unicode%(1) "2" [3]=> bool(false) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_non_indexes.phpt --TEST-- Create a SplFixedArray from an array using the fromArray() function don't try to preserve the indexes. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(1 => 1, 2 => '2', 3 => false), false); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (3) { [0]=> int(1) [1]=> %string|unicode%(1) "2" [2]=> bool(false) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_param_boolean.phpt --TEST-- Tries to create a SplFixedArray using a boolean value. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(true); ?> --EXPECTF-- Warning: SplFixedArray::fromArray() expects parameter 1 to be array, boolean given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt +++ php-src/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt --TEST-- Tries to create a SplFixedArray using the fromArray() function and a multi dimentional array. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = SplFixedArray::fromArray(array(array('1'))); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (1) { [0]=> array(1) { [0]=> %string|unicode%(1) "1" } } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_getSize_pass_param.phpt --TEST-- SplFixedArray::getSize() pass a parameter when none are expected --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); echo "*test* ".$fixed_array->getSize(3); ?> --EXPECTF-- Warning: SplFixedArray::getSize() expects exactly 0 parameters, 1 given in %s on line %d *test* http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_key_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_key_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_key_param.phpt --TEST-- SplFixedArray::key() with a parameter passed. This is a bug and an error should be called. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 3 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->key( array("this","should","not","execute") ); } ?> --EXPECTF-- Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt +++ php-src/ext/spl/tests/SplFixedArray_key_setsize.phpt --TEST-- SplFixedArray::key() when the array has a size higher than the amount of values specified. --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; foreach ( $array as $value ) { echo $array->key( ); } ?> --EXPECT-- 0123 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_next_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_next_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_next_param.phpt --TEST-- SplFixedArray::next() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; $array->next( "invalid" ); ?> --EXPECTF-- Warning: SplFixedArray::next() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetExists_invalid_parameter.phpt --TEST-- SPL FixedArray offsetExists throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetExists(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetExists() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetExists_less_than_zero.phpt --TEST-- SPL FixedArray offsetExists behaviour on a negative index --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); if($array->offsetExists(-10) === false) { echo 'PASS'; } ?> --EXPECT-- PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetGet_invalid_parameter.phpt --TEST-- SPL FixedArray offsetGet throws error on no parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'a'; $a = $array->offsetGet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetGet() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetSet_invalid_parameter.phpt --TEST-- SPL FixedArray offsetSet throws error on no parameters --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetSet(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetSet() expects exactly 2 parameters, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetSet_one_invalid_parameter.phpt --TEST-- SPL FixedArray offsetSet throws error only one parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetSet(2); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetSet() expects exactly 2 parameters, 1 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetUnset_invalid_parameter.phpt --TEST-- SPL FixedArray offsetUnset throws error on no parameter --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $a = $array->offsetUnset(); if(is_null($a)) { echo 'PASS'; } ?> --EXPECTF-- Warning: SplFixedArray::offsetUnset() expects exactly 1 parameter, 0 given in %s on line %d PASS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt +++ php-src/ext/spl/tests/SplFixedArray_offsetUnset_string.phpt --TEST-- Check removing an item from an array when the offset is not an integer. --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a fixed array $fixedArray = new SplFixedArray(5); // Fill it up for ($i=0; $i < 5; $i++) { $fixedArray[$i] = "PHPNW Testfest"; } // remove an item $fixedArray->offsetUnset("4"); var_dump($fixedArray); ?> --EXPECTF-- object(SplFixedArray)#1 (5) { [0]=> %string|unicode%(14) "PHPNW Testfest" [1]=> %string|unicode%(14) "PHPNW Testfest" [2]=> %string|unicode%(14) "PHPNW Testfest" [3]=> %string|unicode%(14) "PHPNW Testfest" [4]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt +++ php-src/ext/spl/tests/SplFixedArray_rewind_param.phpt --TEST-- SplFixedArray::rewind() with a parameter. *BUG* --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php $array = new SplFixedArray( 4 ); $array[0] = "Hello"; $array[1] = "world"; $array[2] = "elePHPant"; $array->rewind( "invalid" ); ?> --EXPECTF-- Warning: SplFixedArray::rewind() expects exactly 0 parameters, 1 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_filled_to_smaller.phpt --TEST-- Create array, fills it with and resizes it to lower value. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 1; $array[1] = 1; $array[2] = 1; $array[3] = 1; $array[4] = 1; $array->setSize(2); var_dump($array); ?> --EXPECT-- object(SplFixedArray)#1 (2) { [0]=> int(1) [1]=> int(1) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_array.phpt --TEST-- SplFixedArray::setSize() with an array parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(array()); var_dump($fixed_array); ?> --EXPECTF-- Warning: SplFixedArray::setSize() expects parameter 1 to be long, array given in %s on line %d object(SplFixedArray)#1 (2) { [0]=> NULL [1]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_float.phpt --TEST-- SplFixedArray::setSize() with a float param --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(3.14159); var_dump($fixed_array); ?> --EXPECTF-- object(SplFixedArray)#1 (3) { [0]=> NULL [1]=> NULL [2]=> NULL } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_param_null.phpt --TEST-- SplFixedArray::setSize() with a null parameter --CREDITS-- PHPNW Testfest 2009 - Adrian Hardy --FILE-- <?php $fixed_array = new SplFixedArray(2); $fixed_array->setSize(null); var_dump($fixed_array); ?> --EXPECT-- object(SplFixedArray)#1 (0) { } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt +++ php-src/ext/spl/tests/SplFixedArray_setSize_reduce.phpt --TEST-- SPL FixedArray can reduce size of array --CREDITS-- PHPNW TestFest 2009 - Ben Longden --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'a'; $array[1] = 'b'; $array[2] = 'c'; $array[3] = 'd'; $array[4] = 'e'; $array->setSize(3); print_r($array); ?> --EXPECT-- SplFixedArray Object ( [0] => a [1] => b [2] => c ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_001.phpt --TEST-- SPL: FixedArray: setsize - populate array, then shrink --CREDITS-- PHPNW TestFest2009 - Rowan Merewood <rowan@merewood.org> --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 'one'; $array[1] = 'two'; $array[2] = 'three'; $array[3] = 'four'; $array[4] = 'five'; $array->setSize(2); var_dump($array); ?> --EXPECTF-- object(SplFixedArray)#1 (2) { [0]=> %string|unicode%(3) "one" [1]=> %string|unicode%(3) "two" } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_grow.phpt --TEST-- SplFixedArray::setSize() grow --CREDITS-- PHPNW Test Fest 2009 - Jordan Hatch --FILE-- <?php echo "\n"; $array = new SplFixedArray(2); $array[0] = "Value 1"; $array[1] = "Value 2"; $array->setSize(4); $array[2] = "Value 3"; $array[3] = "Value 4"; print_r($array); ?> --EXPECT-- SplFixedArray Object ( [0] => Value 1 [1] => Value 2 [2] => Value 3 [3] => Value 4 ) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt +++ php-src/ext/spl/tests/SplFixedArray_setsize_shrink.phpt --TEST-- shrink a full array of integers --CREDITS-- PHPNW Testfest 2009 - Lorna Mitchell --FILE-- <?php $array = new SplFixedArray(5); $array[0] = 1; $array[1] = 1; $array[2] = 1; $array[3] = 1; $array[4] = 1; $array->setSize(4); var_dump($array); ?> --EXPECT-- object(SplFixedArray)#1 (4) { [0]=> int(1) [1]=> int(1) [2]=> int(1) [3]=> int(1) } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt +++ php-src/ext/spl/tests/SplFixedArray_toArray_with-params.phpt --TEST-- Check that passing a parameter to toArray() produces a correct error --CREDITS-- PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) --FILE-- <?php // Create a fixed array $fixedArray = new SplFixedArray(5); // Fill it up for ($i=0; $i < 5; $i++) { $fixedArray[$i] = "PHPNW Testfest"; } // Test count() returns correct error when parameters are passed. $fixedArray->count(1); ?> --EXPECTF-- Warning: SplFixedArray::count() expects exactly 0 parameters, %d given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt +++ php-src/ext/spl/tests/SplFixedarray_offsetExists_larger.phpt --TEST-- Checks that offsetExists() does not accept a value larger than the array. --CREDITS-- PHPNW Test Fest 2009 - Rick Ogden --FILE-- <?php $ar = new SplFixedArray(3); $ar[0] = 1; $ar[1] = 2; $ar[2] = 3; var_dump($ar->offsetExists(4)); ?> --EXPECT-- bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_count_invalid_parameter.phpt --TEST-- Check that SplHeap::count generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->count($input)); } ?> --EXPECTF-- Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::count() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_extract_invalid_parameter.phpt --TEST-- Check that SplHeap::extract generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->extract($input)); } ?> --EXPECTF-- Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_insert_invalid_parameter.phpt --TEST-- Check that SplHeap::insert generate a warning and returns NULL when $value is missing --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplMaxHeap(); var_dump($h->insert()); ?> --EXPECTF-- Warning: SplHeap::insert() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_isEmpty.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_isEmpty.phpt +++ php-src/ext/spl/tests/SplHeap_isEmpty.phpt --TEST-- Check that SplHeap::isEmpty standard success test --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplMaxHeap(); var_dump($h->isEmpty()); ?> --EXPECTF-- bool(true) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplHeap_isEmpty_invalid_parameter.phpt --TEST-- Check that SplHeap::isEmpty generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplMaxHeap(); var_dump($h->isEmpty($input)); } ?> --EXPECTF-- Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_addAll_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::addAll generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->addAll($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, double given in %s on line %d NULL Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_attach_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::attach generates a warning and returns NULL when bad params are passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->attach(true)); var_dump($s->attach(new stdClass, true, true)); ?> --EXPECTF-- Warning: SplObjectStorage::attach() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::attach() expects at most 2 parameters, 3 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_contains_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::contains generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->contains($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::contains() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::contains() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_current_empty_storage.phpt --TEST-- Check that SplObjectStorage::current returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->current()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_detach_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::detach generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->detach($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::detach() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::detach() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_getInfo_empty_storage.phpt --TEST-- Check that SplObjectStorage::getInfo returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->getInfo()); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet.phpt --TEST-- Standard success for SplObjectStorage::offsetGet --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); $o1 = new stdClass(); $s[$o1] = 'some_value'; echo $s->offsetGet($o1); ?> --EXPECT-- some_value http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::offsetGet generate a warning and return NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); $o1 = new stdClass(); $s[$o1] = 'some_value'; var_dump($s->offsetGet($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, array given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, boolean given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, integer given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, double given in %s on line %d NULL Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt +++ php-src/ext/spl/tests/SplObjectStorage_offsetGet_missing_object.phpt --TEST-- Check that SplObjectStorage::offsetGet throws exception when non-existing object is requested --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); $o1 = new stdClass(); try { $s->offsetGet($o1); } catch (UnexpectedValueException $e) { echo $e->getMessage(); } ?> --EXPECT-- Object not found http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_removeAll_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::removeAll generate a warning and returns NULL when passed non-object param --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->removeAll($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, %unicode_string_optional% given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, double given in %s on line %d NULL Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt +++ php-src/ext/spl/tests/SplObjectStorage_setInfo_empty_storage.phpt --TEST-- Check that SplObjectStorage::setInfo returns NULL when storage is empty --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->setInfo('some_value')); ?> --EXPECT-- NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplObjectStorage_setInfo_invalid_parameter.phpt --TEST-- Check that SplObjectStorage::setInfo returns NULL when no param is passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); var_dump($s->setInfo()); ?> --EXPECTF-- Warning: SplObjectStorage::setInfo() expects exactly 1 parameter, 0 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter1.phpt --TEST-- Check that SplObjectStorage::unserialize returns NULL when non-string param is passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( array(), new stdClass(), ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->unserialize($input)); } ?> --EXPECTF-- Warning: SplObjectStorage::unserialize() expects parameter 1 to be %binary_string_optional%, array given in %s on line %d NULL Warning: SplObjectStorage::unserialize() expects parameter 1 to be %binary_string_optional%, object given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter2.phpt --TEST-- Check that SplObjectStorage::unserialize throws exception when numeric value passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( 12345, 1.2345, PHP_INT_MAX, 'x:rubbish', // rubbish after the 'x:' prefix 'x:i:2;O:8:"stdClass":0:{},s:5:"value";;m:a:0:{}', ); foreach($data_provider as $input) { $s = new SplObjectStorage(); try { $s->unserialize($input); } catch(UnexpectedValueException $e) { echo $e->getMessage() . PHP_EOL; } } ?> --EXPECTF-- Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes Error at offset %d of %d bytes http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt +++ php-src/ext/spl/tests/SplObjectStorage_unserialize_invalid_parameter3.phpt --TEST-- Check that SplObjectStorage::unserialize throws exception when NULL passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $s = new SplObjectStorage(); try { $s->unserialize(NULL); } catch(UnexpectedValueException $e) { echo $e->getMessage(); } ?> --EXPECTF-- Empty serialized string cannot be empty http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplPriorityQueue_extract_invalid_parameter.phpt --TEST-- Check that SplPriorityQueue::extract generate a warning and returns NULL when param passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $data_provider = array( new stdClass, array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $h = new SplPriorityQueue(); var_dump($h->extract($input)); } ?> --EXPECTF-- Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL Warning: SplPriorityQueue::extract() expects exactly 0 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt +++ php-src/ext/spl/tests/SplPriorityQueue_insert_invalid_parameter.phpt --TEST-- Check that SplPriorityQueue::insert generate a warning and returns NULL when rubbish params are passed --CREDITS-- PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com) --FILE-- <?php $h = new SplPriorityQueue(); var_dump($h->insert(NULL)); ?> --EXPECTF-- Warning: SplPriorityQueue::insert() expects exactly 2 parameters, 1 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt +++ php-src/ext/spl/tests/SplQueue_setIteratorMode.phpt --TEST-- Check that SplQueue can't be set to LIFO --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $queue = new SplQueue(); try { $queue->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECTF-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt +++ php-src/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt --TEST-- SplQueue setIteratorMode to LIFO produces fail condition in try/catch --CREDITS-- PHPNW Test Fest 2009 - Jeremy Coates jeremy@phpnw.org.uk --FILE-- <?php try { $dll = new SplQueue(); $dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/SplStack_setIteratorMode.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/SplStack_setIteratorMode.phpt +++ php-src/ext/spl/tests/SplStack_setIteratorMode.phpt --TEST-- Check that SplStack can't be set to FIFO --CREDITS-- Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009 --FILE-- <?php $stack = new SplStack(); try { $stack->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECTF-- Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen