Commit 734972e2 authored by Dries's avatar Dries

- Patch #700558 by dww: add test to ensure filename extensions are properly...

- Patch #700558 by dww: add test to ensure filename extensions are properly merged in the Update manager UI.
parent fe1e82ee
...@@ -99,3 +99,16 @@ function update_test_mock_page($project_name) { ...@@ -99,3 +99,16 @@ function update_test_mock_page($project_name) {
$path = drupal_get_path('module', 'update_test'); $path = drupal_get_path('module', 'update_test');
readfile("$path/$project_name.$availability_scenario.xml"); readfile("$path/$project_name.$availability_scenario.xml");
} }
/**
* Implement hook_archiver_info().
*/
function update_test_archiver_info() {
return array(
'update_test_archiver' => array(
// This is bogus, we only care about the extensions for now.
'class' => 'ArchiverUpdateTest',
'extensions' => array('update-test-extension'),
),
);
}
...@@ -564,7 +564,7 @@ class UpdateTestUploadCase extends UpdateTestHelper { ...@@ -564,7 +564,7 @@ class UpdateTestUploadCase extends UpdateTestHelper {
} }
public function setUp() { public function setUp() {
parent::setUp('update'); parent::setUp('update', 'update_test');
variable_set('allow_authorize_operations', TRUE); variable_set('allow_authorize_operations', TRUE);
$admin_user = $this->drupalCreateUser(array('administer software updates', 'administer site configuration')); $admin_user = $this->drupalCreateUser(array('administer software updates', 'administer site configuration'));
$this->drupalLogin($admin_user); $this->drupalLogin($admin_user);
...@@ -593,5 +593,15 @@ class UpdateTestUploadCase extends UpdateTestHelper { ...@@ -593,5 +593,15 @@ class UpdateTestUploadCase extends UpdateTestHelper {
$this->drupalPost('admin/modules/install', $edit, t('Install')); $this->drupalPost('admin/modules/install', $edit, t('Install'));
$this->assertText(t('@module_name is already installed.', array('@module_name' => 'AAA Update test')), 'Existing module was extracted and not reinstalled.'); $this->assertText(t('@module_name is already installed.', array('@module_name' => 'AAA Update test')), 'Existing module was extracted and not reinstalled.');
} }
}
/**
* Ensure that archiver extensions are properly merged in the UI.
*/
function testFileNameExtensionMerging() {
$this->drupalGet('admin/modules/install');
// Make sure the bogus extension supported by update_test.module is there.
$this->assertPattern('/archive extensions are supported:.*update-test-extension/', t("Found 'update-test-extension' extension"));
// Make sure it didn't clobber the first option from core.
$this->assertPattern('/archive extensions are supported:.*zip/', t("Found 'zip' extension"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment