public function MimeMailUnitTestCase::testUrl in Mime Mail 7
File
- tests/
mimemail.test, line 42
Class
- MimeMailUnitTestCase
- Tests helper functions from the Mime Mail module.
Code
public function testUrl() {
$result = _mimemail_url('#');
$this
->assertIdentical($result, '#', 'Hash mark URL without fragment left intact.');
$url = '/sites/default/files/styles/thumbnail/public/image.jpg?itok=Wrl6Qi9U';
$result = _mimemail_url($url, TRUE);
$expected = 'sites/default/files/styles/thumbnail/public/image.jpg';
$this
->assertIdentical($result, $expected, 'Security token removed from styled image URL.');
$expected = $url = 'public://' . $this
->randomName() . ' ' . $this
->randomName() . '.' . $this
->randomName(3);
$result = _mimemail_url($url, TRUE);
$this
->assertIdentical($result, $expected, 'Space in the filename of the attachment left intact.');
}