=== modified file 'modules/system/system.install' --- modules/system/system.install 2009-09-05 13:05:30 +0000 +++ modules/system/system.install 2009-09-05 14:14:11 +0000 @@ -2468,7 +2468,79 @@ function system_update_7037() { return $ret; } + /** - * @} End of "defgroup updates-6.x-to-7.x" - * The next series of updates should start at 8000. + * Test update 1. This should succeed and use the legacy return format. + * + * DO NOT COMMIT THIS FUNCTION. */ +function system_update_9001() { + + $ret[] = array('success' => TRUE, 'query' => t('This is the return message.')); + return $ret; +} + +/** + * Test update 2. This should succeed. + * + * DO NOT COMMIT THIS FUNCTION. + */ +function system_update_9002() { + + // Do something interesting here. + return t('Yay, it worked'); +} + +/** + * Test update 3. This makes sure batching works. + * + * DO NOT COMMIT THIS FUNCITON. + */ +function system_update_9003(&$sandbox) { + + if (empty($sandbox['step'])) { + $sandbox['step'] = 1; + } + + if ($sandbox['step'] == 1) { + $sandbox['#finished'] = 0.5; + } + else { + unset($sandbox['#finished']); + } + + $sandbox['step']++; + + return t('The following value should be 3: ' . $sandbox['step']); +} + +/** + * Test update 4. This should silently pass. + * + * DO NOT COMMIT THIS FUNCTION. + */ +function system_update_9004() { + +} + +/** + * Test update 5. This should fail. + * + * DO NOT COMMIT THIS FUNCTION. + */ +function system_update_9005() { + + throw new DrupalUpdateException(t('This is an error message.')); + + return t('You should not see this message.'); +} + +/** + * Test update 6. This shouldn't even run. + * + * DO NOT COMMIT THIS FUNCTION. + */ +function system_update_9006() { + return t('You should not see this message, either.'); +} +