4, '123abc', 'B', -3
],
];
} /**
* @dataProvider provideIndexOfLast
*/
public function testIndexOfLast(?int
$result, string
$string,
$needle, int
$offset) { $instance =
static::
createFromString($string);
$this->
assertSame($result,
$instance->
indexOfLast($needle,
$offset));
} public static function provideIndexOfLast(): array
{ return [ [null, 'abc', '', 0
],
[null, 'abc', '', -2
],
[null, 'elegant', 'z', -1
],
[0, 'abc',
['abc'
], 0
],
[5, 'DEJAAAA', 'A', -2
],
[74, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, amet sagittis felis.', 'i', 0
],
[