Update changelog, add some tests for rcube_utils::parse_host()

pull/6763/head
Aleksander Machniak 6 years ago
parent 6b5fa52ec1
commit ce52b04051

@ -43,6 +43,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where bmp images couldn't be displayed on some systems (#6728) - Fix bug where bmp images couldn't be displayed on some systems (#6728)
- Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744) - Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744)
- Fix bug where bold/strong text was converted to upper-case on html-to-text conversion (6758) - Fix bug where bold/strong text was converted to upper-case on html-to-text conversion (6758)
- Fix bug in rcube_utils::parse_hosts() where %t, %d, %z could return only tld (#6746)
RELEASE 1.4-rc1 RELEASE 1.4-rc1
--------------- ---------------

@ -634,4 +634,27 @@ class Framework_Utils extends PHPUnit_Framework_TestCase
$this->assertEquals(rcube_utils::idn_to_ascii('H.S'), 'H.S'); $this->assertEquals(rcube_utils::idn_to_ascii('H.S'), 'H.S');
$this->assertEquals(rcube_utils::idn_to_ascii('d.-h.lastname'), 'd.-h.lastname'); $this->assertEquals(rcube_utils::idn_to_ascii('d.-h.lastname'), 'd.-h.lastname');
} }
/**
* Test-Cases for test_parse_host()
*/
function data_parse_host()
{
return array(
array('%z', 'hostname', 'hostname'),
array('%z', 'domain.tld', 'domain.tld'),
array('%z', 'host.domain.tld', 'domain.tld'),
array('%z', 'host1.host2.domain.tld', 'host2.domain.tld'),
);
}
/**
* Test parse_host()
*
* @dataProvider data_parse_host
*/
function test_parse_host($name, $host, $result)
{
$this->assertEquals(rcube_utils::parse_host($name, $host), $result);
}
} }

Loading…
Cancel
Save