// Test the error message in two steps in case there are additional errors
// that change the error message's format.
$this->assertRaw(t('The specified file %name could not be uploaded.',array('%name'=>$text_file->basename)),t('File %filename was not allowed to be uploaded',array('%filename'=>$text_file->filename)));
$this->assertRaw(t('The specified file %name could not be uploaded.',array('%name'=>$text_file->filename)),t('File %filepath was not allowed to be uploaded',array('%filepath'=>$text_file->filepath)));
$this->assertRaw(t('Only files with the following extensions are allowed: %files-allowed.',array('%files-allowed'=>$settings['upload_extensions'])),t('File extension cited as reason for failure'));
// Attempt to upload .html file when .html is only extension allowed.
// Use the HTML file with the .html extension, $html_files[0] has a .txt
// extension.
$html_file=$html_files[1]->filename;
$html_file=$html_files[1]->filepath;
$this->uploadFile($node,$html_file);
$this->assertNoRaw(t('The specified file %name could not be uploaded.',array('%name'=>basename($html_file))),t('File '.$html_file.' was allowed to be uploaded'));
}
...
...
@@ -128,7 +128,7 @@ class UploadTestCase extends DrupalWebTestCase {
@@ -580,9 +580,9 @@ class UserPictureTestCase extends DrupalWebTestCase {
$pic_path=$this->saveUserPicture($image);
// Test that the upload failed and that the correct reason was cited.
$text=t('The specified file %filename could not be uploaded.',array('%filename'=>$image->basename));
$text=t('The specified file %filename could not be uploaded.',array('%filename'=>$image->filename));
$this->assertRaw($text,t('Upload failed.'));
$text=t('The file is %filesize exceeding the maximum file size of %maxsize.',array('%filesize'=>format_size(filesize($image->filename)),'%maxsize'=>format_size($test_size*1024)));
$text=t('The file is %filesize exceeding the maximum file size of %maxsize.',array('%filesize'=>format_size(filesize($image->filepath)),'%maxsize'=>format_size($test_size*1024)));
$this->assertRaw($text,t('File size cited as reason for failure.'));
// Check if file is not uploaded.
...
...
@@ -604,7 +604,7 @@ class UserPictureTestCase extends DrupalWebTestCase {