diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/actions.test | 6 | ||||
-rw-r--r-- | modules/simpletest/tests/database_test.test | 27 |
2 files changed, 31 insertions, 2 deletions
diff --git a/modules/simpletest/tests/actions.test b/modules/simpletest/tests/actions.test index 12a97cc5f..7cc06b558 100644 --- a/modules/simpletest/tests/actions.test +++ b/modules/simpletest/tests/actions.test @@ -37,11 +37,13 @@ class ActionsConfigurationTestCase extends DrupalWebTestCase { // Make another POST request to the action edit page. $this->clickLink(t('configure')); + preg_match('|admin/config/system/actions/configure/(\d+)|', $this->getUrl(), $matches); + $aid = $matches[1]; $edit = array(); $new_action_label = $this->randomName(); $edit['actions_label'] = $new_action_label; $edit['url'] = 'admin'; - $this->drupalPost('admin/config/system/actions/configure/1', $edit, t('Save')); + $this->drupalPost(NULL, $edit, t('Save')); // Make sure that the action updated properly. $this->assertText(t('The action has been successfully saved.'), t("Make sure we get a confirmation that we've successfully updated the complex action.")); @@ -51,7 +53,7 @@ class ActionsConfigurationTestCase extends DrupalWebTestCase { // Make sure that deletions work properly. $this->clickLink(t('delete')); $edit = array(); - $this->drupalPost('admin/config/system/actions/delete/1', $edit, t('Delete')); + $this->drupalPost("admin/config/system/actions/delete/$aid", $edit, t('Delete')); // Make sure that the action was actually deleted. $this->assertRaw(t('Action %action was deleted', array('%action' => $new_action_label)), t('Make sure that we get a delete confirmation message.')); diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 8d400e68c..d64ee9ed0 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -2981,3 +2981,30 @@ class DatabaseExtraTypesTestCase extends DrupalWebTestCase { } + +/** + * Check the sequences API. + */ +class DatabaseNextIdCase extends DrupalWebTestCase { + function getInfo() { + return array( + 'name' => t('Sequences API'), + 'description' => t('Test the secondary sequences API.'), + 'group' => t('Database'), + ); + } + + /** + * Test that the sequences API work. + */ + function testDbNextId() { + $first = db_next_id(); + $second = db_next_id(); + // We can test for exact increase in here because we know there is no + // other process operating on these tables -- normally we could only + // expect $second > $first. + $this->assertEqual($first + 1, $second, t('The second call from a sequence provides a number increased by one.')); + $result = db_next_id(1000); + $this->assertEqual($result, 1001, t('Sequence provides a larger number than the existing ID.')); + } +} |