'administer software updates',
'administer site configuration',
]);
$this->
drupalLogin($admin_user);
} /**
* Tests upload, extraction, and update of a module.
*/
public function testUploadModule() { // Ensure that the update information is correct before testing.
update_get_available(TRUE
);
// Images are not valid archives, so get one and try to install it. We
// need an extra variable to store the result of drupalGetTestFiles()
// since reset() takes an argument by reference and passing in a constant
// emits a notice in strict mode.
$imageTestFiles =
$this->
drupalGetTestFiles('image'
);
$invalidArchiveFile =
reset($imageTestFiles);
$edit =
[ 'files[project_upload]' =>
$invalidArchiveFile->uri,
];
// This also checks that the correct archive extensions are allowed.