/** * @test * @dataProvider indexOfExamples */ public function indexOfWorks($array, $searchElement, $fromIndex, $expected) { $helper = new ArrayHelper(); if ($fromIndex !== null) { $result = $helper->indexOf($array, $searchElement, $fromIndex); } else { $result = $helper->indexOf($array, $searchElement); } $this->assertEquals($expected, $result); }