' ',
],
];
} /**
* @dataProvider provideBeforeAfter
*/
public function testBeforeAfter(string
$expected, string
$needle, string
$origin, int
$offset, bool
$before) { $result =
static::
createFromString($origin);
$result =
$before ?
$result->
before($needle, false,
$offset) :
$result->
after($needle, true,
$offset);
$this->
assertEquals(static::
createFromString($expected),
$result);
} public static function provideBeforeAfter() { return [ ['hello world', '', 'hello world', 0, true
],
['hello world', '', 'hello world', 0, false
],
['hello World', 'w', 'hello World', 0, true
],
['hello World', 'w', 'hello World', 0, false
],
['hello world', 'o', 'hello world', 10, true
],
[