php-src/ext/standard/tests/strings/chunk_split_basic.phpt
Steph Fox 87fac43ac0 - killed off UEXPECT
- html_translation_table and setlocale tests are no longer relevant
- there are a number of ANSI-encoded files. Is this deliberate?
2008-05-27 10:50:48 +00:00

53 lines
1.4 KiB
PHP

--TEST--
Test chunk_split() function : basic functionality
--FILE--
<?php
/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
* Description: Returns split line
* Source code: ext/standard/string.c
* Alias to functions:
*/
/*
* Testing chunk_split() for basic functionality by passing all possible
* arguments as well as with default arguments chunklen and ending
*/
echo "*** Testing chunk_split() : basic functionality ***\n";
// Initialise all required variables
$str = 'Testing';
$chunklen = 2;
$ending = '##';
// Calling chunk_split() with all possible arguments
echo "-- Testing chunk_split() with all possible arguments --\n";
var_dump( chunk_split($str, $chunklen, $ending) );
// Calling chunk_split() with default ending string
echo "-- Testing chunk_split() with default ending string --\n";
var_dump( chunk_split($str, $chunklen) );
//Calling chunk_split() with default chunklen and ending string
echo "-- Testing chunk_split() with default chunklen and ending string --\n";
var_dump( chunk_split($str) );
echo "Done"
?>
--EXPECT--
*** Testing chunk_split() : basic functionality ***
-- Testing chunk_split() with all possible arguments --
unicode(15) "Te##st##in##g##"
-- Testing chunk_split() with default ending string --
unicode(15) "Te
st
in
g
"
-- Testing chunk_split() with default chunklen and ending string --
unicode(9) "Testing
"
Done