Skip to content

Commit 04803b6

Browse files
Merge branch '5.0'
* 5.0: [String] add test case for wordwrap method [Process] - update @throws phpdoc [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails [HttpKernel][FileLocator] Fix deprecation message
2 parents f29af65 + 4a1bd8a commit 04803b6

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

Tests/AbstractAsciiTestCase.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,50 @@ public function testUnwrap()
6666
$this->assertEquals($expected, $actual);
6767
}
6868

69+
/**
70+
* @dataProvider wordwrapProvider
71+
*/
72+
public function testWordwrap($expected, $actual, $length, $break, $cut = false)
73+
{
74+
$instance = static::createFromString($actual);
75+
$actual = $instance->wordwrap($length, $break, $cut);
76+
77+
$this->assertEquals($expected, $actual);
78+
}
79+
80+
public function wordwrapProvider()
81+
{
82+
return [
83+
[
84+
'Lo-re-m-Ip-su-m',
85+
'Lorem Ipsum',
86+
2,
87+
'-',
88+
true,
89+
],
90+
[
91+
'Lorem-Ipsum',
92+
'Lorem Ipsum',
93+
2,
94+
'-',
95+
],
96+
[
97+
'Lor-em-Ips-um',
98+
'Lorem Ipsum',
99+
3,
100+
'-',
101+
true,
102+
],
103+
[
104+
'L-o-r-e-m-I-p-s-u-m',
105+
'Lorem Ipsum',
106+
1,
107+
'-',
108+
true,
109+
],
110+
];
111+
}
112+
69113
/**
70114
* @dataProvider provideWrap
71115
*/

0 commit comments

Comments
 (0)