t('Country functionality'),
'description' => t('Import, edit, and remove countries and their settings.'),
'group' => t('Ubercart'),
);
}
function setUp() {
parent::setUp('token', 'uc_store');
$admin_user = $this->drupalCreateUser(array('administer store'));
$this->drupalLogin($admin_user);
}
function testCountry() {
$import_file = 'belgium_56_3.cif';
$country_name = 'Belgium';
$country_code = 'BEL';
$this->drupalGet('admin/store/settings/countries/edit');
$this->assertRaw('', t('Ensure country file is not imported yet.'));
$edit = array(
'import_file[]' => array($import_file => $import_file),
);
$this->drupalPost('admin/store/settings/countries/edit', $edit, t('Import'));
$this->assertText(t('Country file @file imported.', array('@file' => $import_file)), t('Country was imported successfully.'));
$this->assertText($country_code, t('Country appears in the imported countries table.'));
$this->assertNoRaw('', t('Country does not appear in list of files to be imported.'));
$this->clickLink(t('disable'));
$this->assertText(t('@name disabled.', array('@name' => $country_name)), t('Country was disabled.'));
$this->clickLink(t('enable'));
$this->assertText(t('@name enabled.', array('@name' => $country_name)), t('Country was enabled.'));
$this->clickLink(t('remove'));
$this->assertText(t('Are you sure you want to remove @name from the system?', array('@name' => $country_name)), t('Confirm form is displayed.'));
$this->drupalPost('admin/store/settings/countries/56/remove', array(), t('Remove'));
$this->assertText(t('@name removed.', array('@name' => $country_name)), t('Country removed.'));
$this->assertRaw('', t('Ensure country file is not imported yet.'));
$this->assertNoText($country_code, t('Country does not appear in imported countries table.'));
}
}