1--TEST--
2Test wordwrap() function : usage variations  - valid break arguments(spaces)
3--FILE--
4<?php
5/*
6 *test wordwrap() with break arguments as single spaces
7*/
8
9echo "*** Testing wordwrap() : usage variations ***\n";
10
11// Initialize all required variables
12$str = "Testing wordrap function";
13$width = 1;
14$cut = false;
15
16echo "\n-- Testing wordwrap() with default break value and single space as value --\n";
17echo "-- with default break and cut value --\n";
18var_dump( wordwrap($str, $width) );  // default break and cut value
19
20echo "-- with default cut value --\n";
21$break = ' ';
22$break1 = "  ";
23var_dump( wordwrap($str, $width, $break) );
24var_dump( wordwrap($str, $width, $break1) );
25
26echo "-- with cut value as false --\n";
27$cut = false;
28var_dump( wordwrap($str, $width, $break, $cut) );
29var_dump( wordwrap($str, $width, $break1, $cut) );
30
31echo "-- with cut value as true --\n";
32$cut = true;
33var_dump( wordwrap($str, $width, $break, $cut) );
34var_dump( wordwrap($str, $width, $break1, $cut) );
35
36echo "Done\n";
37?>
38--EXPECT--
39*** Testing wordwrap() : usage variations ***
40
41-- Testing wordwrap() with default break value and single space as value --
42-- with default break and cut value --
43string(24) "Testing
44wordrap
45function"
46-- with default cut value --
47string(24) "Testing wordrap function"
48string(26) "Testing  wordrap  function"
49-- with cut value as false --
50string(24) "Testing wordrap function"
51string(26) "Testing  wordrap  function"
52-- with cut value as true --
53string(43) "T e s t i n g w o r d r a p f u n c t i o n"
54string(64) "T  e  s  t  i  n  g  w  o  r  d  r  a  p  f  u  n  c  t  i  o  n"
55Done
56