diff options
Diffstat (limited to 'ext/standard/tests/array/array_chunk_variation5.phpt')
-rw-r--r-- | ext/standard/tests/array/array_chunk_variation5.phpt | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt index 50050892e7..21f1a3dce2 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -26,26 +26,33 @@ $sizes = array(-1, count($input_array) + 1, 0, 1.5); // loop through the array for size argument foreach ($sizes as $size){ - echo "\n-- Testing array_chunk() when size = $size --\n"; - var_dump( array_chunk($input_array, $size) ); - var_dump( array_chunk($input_array, $size, true) ); - var_dump( array_chunk($input_array, $size, false) ); + echo "\n-- Testing array_chunk() when size = $size --\n"; + try { + var_dump( array_chunk($input_array, $size) ); + } catch (\Error $e) { + echo $e->getMessage() . "\n"; + } + try { + var_dump( array_chunk($input_array, $size, true) ); + } catch (\Error $e) { + echo $e->getMessage() . "\n"; + } + try { + var_dump( array_chunk($input_array, $size, false) ); + } catch (\Error $e) { + echo $e->getMessage() . "\n"; + } } -echo "Done"; ?> ---EXPECTF-- + +DONE +--EXPECT-- *** Testing array_chunk() : usage variations *** -- Testing array_chunk() when size = -1 -- - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL +Size parameter expected to be greater than 0 +Size parameter expected to be greater than 0 +Size parameter expected to be greater than 0 -- Testing array_chunk() when size = 4 -- array(1) { @@ -83,15 +90,9 @@ array(1) { } -- Testing array_chunk() when size = 0 -- - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL - -Warning: array_chunk(): Size parameter expected to be greater than 0 in %s on line %d -NULL +Size parameter expected to be greater than 0 +Size parameter expected to be greater than 0 +Size parameter expected to be greater than 0 -- Testing array_chunk() when size = 1.5 -- array(3) { @@ -145,4 +146,5 @@ array(3) { int(3) } } -Done + +DONE |