/** * Tests the utf8::str_pad() function. * @dataProvider str_pad_provider * @group core.helpers.utf8.str_pad * @test */ public function str_pad($str, $final_str_length, $pad_str, $pad_type, $expected_result) { if ($pad_type === -1) { $this->setExpectedException('PHPUnit_Framework_Error'); $result = utf8::str_pad($str, $final_str_length, $pad_str, $pad_type); } else { $result = utf8::str_pad($str, $final_str_length, $pad_str, $pad_type); $this->assertEquals($expected_result, $result); } }