security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -41,6 +41,55 @@ class MimeMailUnitTestCase extends DrupalUnitTestCase {
|
||||
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.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests functions from the Mime Mail module.
|
||||
*/
|
||||
class MimeMailWebTestCase extends DrupalWebTestCase {
|
||||
protected $adminUser;
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Mime Mail web tests',
|
||||
'description' => 'Test that Mime Mail works properly.',
|
||||
'group' => 'Mime Mail',
|
||||
);
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp('mailsystem', 'mimemail');
|
||||
|
||||
// Create and login user.
|
||||
$this->adminUser = $this->drupalCreateUser(array(
|
||||
'access administration pages',
|
||||
'administer site configuration',
|
||||
));
|
||||
|
||||
$this->drupalLogin($this->adminUser);
|
||||
}
|
||||
|
||||
public function testUrl() {
|
||||
$this->drupalPost('admin/config/system/mimemail',
|
||||
array('mimemail_linkonly' => TRUE),
|
||||
t('Save configuration'));
|
||||
|
||||
$url = 'public://' . $this->randomName() . ' '. $this->randomName() . '.jpg';
|
||||
$result = _mimemail_url($url, TRUE);
|
||||
$expected = str_replace(' ', '%20', file_create_url($url));
|
||||
$message = 'Stream wrapper converted to web accessible URL for linked image.';
|
||||
$this->assertIdentical($result, $expected, $message);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user