Examples::
String.startsWith('Hello world!', 'Hello') == true
String.startsWith('My hovercraft is full of...', 'Hello') == false
String.startsWith('My hovercraft is full of...', 'hovercraft', 3) == true
/** * @test * @dataProvider startsWithExamples */ public function startsWithWorks($string, $search, $position, $expected) { $helper = new StringHelper(); $result = $helper->startsWith($string, $search, $position); $this->assertSame($expected, $result); }