@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
// Simulate duplicated permission condition.
|
||||
db_update('permission')->fields(array(
|
||||
'perm' => 'access content, access content',
|
||||
))
|
||||
->condition('pid', 1)
|
||||
->execute();
|
@@ -566,6 +566,20 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
|
||||
// Confirm that no {menu_links} entry exists for user/autocomplete.
|
||||
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
|
||||
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
|
||||
|
||||
// Confirm that a date format that just differs in the case can be added.
|
||||
$admin_date_format = 'j M y';
|
||||
$edit = array('date_format' => $admin_date_format);
|
||||
$this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
|
||||
|
||||
// Add a new date format which just differs in the case.
|
||||
$admin_date_format_uppercase = 'j M Y';
|
||||
$edit = array('date_format' => $admin_date_format_uppercase);
|
||||
$this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
|
||||
$this->assertText(t('Custom date format added.'));
|
||||
|
||||
// Verify that the unique key on {date_formats}.format still exists.
|
||||
$this->assertTrue(db_index_exists('date_formats', 'formats'), 'Unique key on {date_formats} exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -61,3 +61,32 @@ class UserUpgradePathNoPasswordTokenTestCase extends UpgradePathTestCase {
|
||||
$this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), '[user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token not involved).');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade test for user.module (duplicated permission).
|
||||
*/
|
||||
class UserUpgradePathDuplicatedPermissionTestCase extends UpgradePathTestCase {
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'User upgrade path (duplicated permission)',
|
||||
'description' => 'User upgrade path tests (duplicated permission).',
|
||||
'group' => 'Upgrade path',
|
||||
);
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
// Path to the database dump files.
|
||||
$this->databaseDumpFiles = array(
|
||||
drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.bare.database.php',
|
||||
drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.duplicate-permission.database.php',
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a successful upgrade.
|
||||
*/
|
||||
public function testUserUpgrade() {
|
||||
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user