minor #35236 [String] add test case for wordwrap method (mgamal92)
This PR was submitted for the master branch but it was squashed and merged into the 5.0 branch instead.
Discussion
----------
[String] add test case for wordwrap method
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
Just test case for ```wordwrap``` method
Commits
-------
c314598df9
[String] add test case for wordwrap method
This commit is contained in:
commit
3b3cbb925c
@ -55,6 +55,50 @@ abstract class AbstractAsciiTestCase extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider wordwrapProvider
|
||||
*/
|
||||
public function testWordwrap($expected, $actual, $length, $break, $cut = false)
|
||||
{
|
||||
$instance = static::createFromString($actual);
|
||||
$actual = $instance->wordwrap($length, $break, $cut);
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function wordwrapProvider()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'Lo-re-m-Ip-su-m',
|
||||
'Lorem Ipsum',
|
||||
2,
|
||||
'-',
|
||||
true,
|
||||
],
|
||||
[
|
||||
'Lorem-Ipsum',
|
||||
'Lorem Ipsum',
|
||||
2,
|
||||
'-',
|
||||
],
|
||||
[
|
||||
'Lor-em-Ips-um',
|
||||
'Lorem Ipsum',
|
||||
3,
|
||||
'-',
|
||||
true,
|
||||
],
|
||||
[
|
||||
'L-o-r-e-m-I-p-s-u-m',
|
||||
'Lorem Ipsum',
|
||||
1,
|
||||
'-',
|
||||
true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideWrap
|
||||
*/
|
||||
|
Reference in New Issue
Block a user