Example::
String.replace("canal", "ana", "oo") == "cool"
Note: this method does not perform regular expression matching, @see pregReplace().
/** * @test * @dataProvider replaceExamples */ public function replaceWorks($string, $search, $replace, $expected) { $helper = new StringHelper(); $result = $helper->replace($string, $search, $replace); $this->assertSame($expected, $result); }