assertInstanceOf('rcube_string_replacer', $sr, "Class constructor"); } /** * Data for test_replace() */ function data_replace() { return array( array('http://domain.tld/path*path2', 'http://domain.tld/path*path2'), array("Click this link:\nhttps://mail.xn--brderli-o2a.ch/rc/ EOF", "Click this link:\nhttps://mail.xn--brderli-o2a.ch/rc/ EOF"), array('Start http://localhost/?foo End', 'Start http://localhost/?foo End'), array('www.domain.tld', 'www.domain.tld'), array('WWW.DOMAIN.TLD', 'WWW.DOMAIN.TLD'), ); } /** * @dataProvider data_replace */ function test_replace($input, $output) { $replacer = new rcube_string_replacer; $result = $replacer->replace($input); $result = $replacer->resolve($result); $this->assertEquals($output, $result); } }