From 22c67d0ec28f4c9488d26aa35151392a18c74c45 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 18 Oct 2012 10:49:58 +0200 Subject: Fix handling of URLs with asterisk characters (#1488759) --- tests/Framework/StringReplacer.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php index 11210c0da..6081e5377 100644 --- a/tests/Framework/StringReplacer.php +++ b/tests/Framework/StringReplacer.php @@ -17,4 +17,28 @@ class Framework_StringReplacer extends PHPUnit_Framework_TestCase $this->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('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); + } } -- cgit v1.2.3