forked from MathHubInfo/Legacy-planetary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Install, update and uninstall functions for the node_access_test module. | ||
*/ | ||
|
||
/** | ||
* Implements hook_schema(). | ||
*/ | ||
function node_access_test_schema() { | ||
$schema['node_access_test'] = array( | ||
'description' => 'The base table for node_access_test.', | ||
'fields' => array( | ||
'nid' => array( | ||
'description' => 'The {node}.nid this record affects.', | ||
'type' => 'int', | ||
'unsigned' => TRUE, | ||
'not null' => TRUE, | ||
'default' => 0, | ||
), | ||
'private' => array( | ||
'description' => 'Boolean indicating whether the node is private (visible to administrator) or not (visible to non-administrators).', | ||
'type' => 'int', | ||
'not null' => TRUE, | ||
'default' => 0, | ||
), | ||
), | ||
'indexes' => array( | ||
'nid' => array('nid'), | ||
), | ||
'primary key' => array('nid'), | ||
'foreign keys' => array( | ||
'versioned_node' => array( | ||
'table' => 'node', | ||
'columns' => array('nid' => 'nid'), | ||
), | ||
), | ||
); | ||
|
||
return $schema; | ||
} | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Install, update and uninstall functions for the node_access_test module. | ||
*/ | ||
|
||
/** | ||
* Implements hook_schema(). | ||
*/ | ||
function node_access_test_schema() { | ||
$schema['node_access_test'] = array( | ||
'description' => 'The base table for node_access_test.', | ||
'fields' => array( | ||
'nid' => array( | ||
'description' => 'The {node}.nid this record affects.', | ||
'type' => 'int', | ||
'unsigned' => TRUE, | ||
'not null' => TRUE, | ||
'default' => 0, | ||
), | ||
'private' => array( | ||
'description' => 'Boolean indicating whether the node is private (visible to administrator) or not (visible to non-administrators).', | ||
'type' => 'int', | ||
'not null' => TRUE, | ||
'default' => 0, | ||
), | ||
), | ||
'indexes' => array( | ||
'nid' => array('nid'), | ||
), | ||
'primary key' => array('nid'), | ||
'foreign keys' => array( | ||
'versioned_node' => array( | ||
'table' => 'node', | ||
'columns' => array('nid' => 'nid'), | ||
), | ||
), | ||
); | ||
|
||
return $schema; | ||
} |
10 changes: 10 additions & 0 deletions
10
modules/simpletest/tests/upgrade/drupal-6.menu.database.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
db_insert('variable')->fields(array( | ||
'name', | ||
'value', | ||
)) | ||
->values(array( | ||
'name' => 'menu_default_node_menu', | ||
'value' => 's:15:"secondary-links";', | ||
)) | ||
->execute(); |
10 changes: 10 additions & 0 deletions
10
modules/simpletest/tests/upgrade/drupal-6.user-no-password-token.database.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
db_insert('variable')->fields(array( | ||
'name', | ||
'value', | ||
)) | ||
->values(array( | ||
'name' => 'user_mail_register_no_approval_required_body', | ||
'value' => 's:86:"!username, !site, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.";', | ||
)) | ||
->execute(); |
10 changes: 10 additions & 0 deletions
10
modules/simpletest/tests/upgrade/drupal-6.user-password-token.database.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
db_insert('variable')->fields(array( | ||
'name', | ||
'value', | ||
)) | ||
->values(array( | ||
'name' => 'user_mail_register_no_approval_required_body', | ||
'value' => 's:97:"!password, !username, !site, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.";', | ||
)) | ||
->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* Upgrade test for menu.module. | ||
*/ | ||
class MenuUpgradePathTestCase extends UpgradePathTestCase { | ||
public static function getInfo() { | ||
return array( | ||
'name' => 'Menu upgrade path', | ||
'description' => 'Menu upgrade path tests.', | ||
'group' => 'Upgrade path', | ||
); | ||
} | ||
|
||
public function setUp() { | ||
// Path to the database dump files. | ||
$this->databaseDumpFiles = array( | ||
drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php', | ||
drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.menu.database.php', | ||
); | ||
parent::setUp(); | ||
|
||
$this->uninstallModulesExcept(array('menu')); | ||
} | ||
|
||
/** | ||
* Test a successful upgrade. | ||
*/ | ||
public function testMenuUpgrade() { | ||
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); | ||
|
||
// Test the migration of "Default menu for content" setting to individual node types. | ||
$this->drupalGet("admin/structure/types/manage/page/edit"); | ||
$this->assertNoFieldChecked('edit-menu-options-management', 'Management menu is not selected as available menu'); | ||
$this->assertNoFieldChecked('edit-menu-options-navigation', 'Navigation menu is not selected as available menu'); | ||
$this->assertNoFieldChecked('edit-menu-options-primary-links', 'Primary Links menu is not selected as available menu'); | ||
$this->assertFieldChecked('edit-menu-options-secondary-links', 'Secondary Links menu is selected as available menu'); | ||
$this->assertNoFieldChecked('edit-menu-options-user-menu', 'User menu is not selected as available menu'); | ||
$this->assertOptionSelected('edit-menu-parent', 'secondary-links:0', 'Secondary links is selected as default parent item'); | ||
|
||
$this->assertEqual(variable_get('menu_default_node_menu'), NULL, 'Redundant variable menu_default_node_menu has been removed'); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* Upgrade test for user.module (password token involved). | ||
*/ | ||
class UserUpgradePathPasswordTokenTestCase extends UpgradePathTestCase { | ||
public static function getInfo() { | ||
return array( | ||
'name' => 'User upgrade path (password token involved)', | ||
'description' => 'User upgrade path tests (password token involved).', | ||
'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.user-password-token.database.php', | ||
); | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* Test a successful upgrade. | ||
*/ | ||
public function testUserUpgrade() { | ||
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); | ||
$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 involved).'); | ||
} | ||
} | ||
|
||
/** | ||
* Upgrade test for user.module (password token not involved). | ||
*/ | ||
class UserUpgradePathNoPasswordTokenTestCase extends UpgradePathTestCase { | ||
public static function getInfo() { | ||
return array( | ||
'name' => 'User upgrade path (password token not involved)', | ||
'description' => 'User upgrade path tests (password token not involved).', | ||
'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.user-no-password-token.database.php', | ||
); | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* Test a successful upgrade. | ||
*/ | ||
public function testUserUpgrade() { | ||
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); | ||
$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).'); | ||
} | ||
} |