public static function stringEndsWith($haystack, $needle)
{
if (substr($haystack, -strlen($needle)) === $needle) {
return true;
}
return false;
}
/** * @test * @dataProvider sampleHaystackStringsAndNeedleStrings */ public function stringIsFoundAtEndingOfAnotherString($haystack, $needle, $comparison) { $expectedResult = $comparison === 'ending' || $comparison === 'both' ? true : false; $result = I18n\Utility::stringEndsWith($haystack, $needle); $this->assertEquals($expectedResult, $result); }