// The victim's temporary file should not be removed by the attacker's
// POST request.
$this->assertFileExists($victim_tmp_file);
}
}
/**
* Tests upload and remove buttons for multiple multi-valued File fields.
*/
...
...
@@ -1365,3 +1503,178 @@ class FilePrivateTestCase extends FileFieldTestCase {
$this->assertResponse(403,'Confirmed that access is denied for the file without view field access permission after attempting to attach it to a new node.');
}
}
/**
* Confirm that file field submissions work correctly for anonymous visitors.
@@ -269,7 +285,7 @@ class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase {
$this->assertEqual($this->drupalGetHeader('Content-Length'),$generated_image_info['file_size'],'Expected Content-Length was reported.');
if($scheme=='private'){
$this->assertEqual($this->drupalGetHeader('Expires'),'Sun, 19 Nov 1978 05:00:00 GMT','Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'),'no-cache, must-revalidate, post-check=0, pre-check=0','Cache-Control header was set to prevent caching.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'),'no-cache, must-revalidate','Cache-Control header was set to prevent caching.');
$this->assertEqual($this->drupalGetHeader('X-Image-Owned-By'),'image_module_test','Expected custom header has been added.');
// Make sure that a second request to the already existing derivate works
@@ -1194,7 +1194,7 @@ function locale_translate_edit_form_submit($form, &$form_state) {
$translation=db_query("SELECT translation FROM {locales_target} WHERE lid = :lid AND language = :language",array(':lid'=>$lid,':language'=>$key))->fetchField();
if(!empty($value)){
// Only update or insert if we have a value to use.
$this->assertEqual($node_reloaded->language,$langcode,format_string('The language code of the node was successfully set to @langcode.',array('@langcode'=>$langcode)));
}
}
}
/**
...
...
@@ -2629,6 +2670,68 @@ class LocaleUrlRewritingTest extends DrupalWebTestCase {
$this->drupalGet("$prefix/$path");
$this->assertResponse(404,$message2);
}
/**
* Check URL rewriting when using a domain name and a non-standard port.
$this->assertEqual($url,$expected,'The right port is used.');
// If we set the port explicitly in url(), it should not be overriden.
$url=url('',array(
'absolute'=>TRUE,
'language'=>$language,
'base_url'=>$GLOBALS['base_url'].':90',
));
$expected='http://example.fr:90/';
$expected.=$index_php?'index.php/':'';
$this->assertEqual($url,$expected,'A given port is not overriden.');
// Restore HTTP_HOST.
$_SERVER['HTTP_HOST']=$http_host;
}
}
/**
...
...
@@ -3141,3 +3244,46 @@ class LocaleCSSAlterTest extends DrupalWebTestCase {
$this->assertRaw('@import url("'.$base_url.'/modules/system/system.messages.css'.$query_string.'");'."\n".'@import url("'.$base_url.'/modules/system/system.messages-rtl.css'.$query_string.'");'."\n",'CSS: system.messages-rtl.css is added directly after system.messages.css.');
'#description'=>t('The path for this menu link. This can be an internal Drupal path such as %add-node or an external URL such as %drupal. Enter %front to link to the front page.',array('%front'=>'<front>','%add-node'=>'node/add','%drupal'=>'http://drupal.org')),
'#description'=>t('The path for this menu link. This can be an internal path such as %add-node or an external URL such as %example. Enter %front to link to the front page.',array('%front'=>'<front>','%add-node'=>'node/add','%example'=>'http://example.com')),
// Verify that the menu link title on the node add form has the correct
// maxlength.
$this->drupalGet('node/add/page');
$this->assertPattern('/<input .* id="edit-menu-link-title" .* maxlength="255" .* \/>/','Menu link title field has correct maxlength in node add form.');
// Create a node with menu link disabled.
$node_title=$this->randomName();
$language=LANGUAGE_NONE;
$edit=array(
...
...
@@ -684,6 +689,10 @@ class MenuNodeTestCase extends DrupalWebTestCase {
$this->drupalGet('node/'.$node->nid.'/edit');
$this->assertOptionSelected('edit-menu-weight',17,'Menu weight correct in edit form');
// Verify that the menu link title on the node edit form has the correct
// maxlength.
$this->assertPattern('/<input .* id="edit-menu-link-title" .* maxlength="255" .* \/>/','Menu link title field has correct maxlength in node edit form.');
@@ -680,11 +680,11 @@ class OpenIDTestCase extends DrupalWebTestCase {
* Test _openid_dh_XXX_to_XXX() functions.
*/
functiontestConversion(){
$this->assertEqual(_openid_dh_long_to_base64('12345678901234567890123456789012345678901234567890'),'CHJ/Y2mq+DyhUCZ0evjH8ZbOPwrS','_openid_dh_long_to_base64() returned expected result.');
$this->assertEqual(_openid_dh_base64_to_long('BsH/g8Nrpn2dtBSdu/sr1y8hxwyx'),'09876543210987654321098765432109876543210987654321','_openid_dh_base64_to_long() returned expected result.');
$this->assertIdentical(_openid_dh_long_to_base64('12345678901234567890123456789012345678901234567890'),'CHJ/Y2mq+DyhUCZ0evjH8ZbOPwrS','_openid_dh_long_to_base64() returned expected result.');
$this->assertIdentical(_openid_dh_base64_to_long('BsH/g8Nrpn2dtBSdu/sr1y8hxwyx'),'9876543210987654321098765432109876543210987654321','_openid_dh_base64_to_long() returned expected result.');
$this->assertEqual(_openid_dh_long_to_binary('12345678901234567890123456789012345678901234567890'),"\x08r\x7fci\xaa\xf8<\xa1P&tz\xf8\xc7\xf1\x96\xce?\x0a\xd2",'_openid_dh_long_to_binary() returned expected result.');
$this->assertEqual(_openid_dh_binary_to_long("\x06\xc1\xff\x83\xc3k\xa6}\x9d\xb4\x14\x9d\xbb\xfb+\xd7/!\xc7\x0c\xb1"),'09876543210987654321098765432109876543210987654321','_openid_dh_binary_to_long() returned expected result.');
$this->assertIdentical(_openid_dh_long_to_binary('12345678901234567890123456789012345678901234567890'),"\x08r\x7fci\xaa\xf8<\xa1P&tz\xf8\xc7\xf1\x96\xce?\x0a\xd2",'_openid_dh_long_to_binary() returned expected result.');
$this->assertIdentical(_openid_dh_binary_to_long("\x06\xc1\xff\x83\xc3k\xa6}\x9d\xb4\x14\x9d\xbb\xfb+\xd7/!\xc7\x0c\xb1"),'9876543210987654321098765432109876543210987654321','_openid_dh_binary_to_long() returned expected result.');