Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.486 diff -u -r1.486 book.module --- modules/book/book.module 18 Feb 2009 13:46:53 -0000 1.486 +++ modules/book/book.module 20 Feb 2009 03:14:44 -0000 @@ -7,6 +7,26 @@ */ /** + * Implementation of hook_test(). + */ +function book_test() { + $tests = array(); + + $tests['BookTestCase'] = array( + 'name' => t('Book functionality'), + 'description' => t('Create a book, add pages, and test book interface.'), + 'group' => t('Book'), + ); + $tests['BookBlockTestCase'] = array( + 'name' => t('Block availability'), + 'description' => t('Check if the book navigation block is available.'), + 'group' => t('Book'), + ); + + return $tests; +} + +/** * Implementation of hook_theme(). */ function book_theme() { Index: modules/book/book.test =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.test,v retrieving revision 1.7 diff -u -r1.7 book.test --- modules/book/book.test 23 Dec 2008 14:32:08 -0000 1.7 +++ modules/book/book.test 20 Feb 2009 03:14:44 -0000 @@ -4,14 +4,6 @@ class BookTestCase extends DrupalWebTestCase { protected $book; - function getInfo() { - return array( - 'name' => t('Book functionality'), - 'description' => t('Create a book, add pages, and test book interface.'), - 'group' => t('Book'), - ); - } - function setUp() { parent::setUp('book'); } @@ -174,13 +166,6 @@ } class BookBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block availability'), - 'description' => t('Check if the book navigation block is available.'), - 'group' => t('Book'), - ); - } function setUp() { parent::setUp('book'); Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.404 diff -u -r1.404 aggregator.module --- modules/aggregator/aggregator.module 26 Jan 2009 14:08:42 -0000 1.404 +++ modules/aggregator/aggregator.module 20 Feb 2009 03:14:43 -0000 @@ -7,6 +7,51 @@ */ /** + * Implementation of hook_test(). + */ +function aggregator_test() { + $tests = array(); + + $tests['AddFeedTestCase'] = array( + 'name' => t('Add feed functionality'), + 'description' => t('Add feed test.'), + 'group' => t('Aggregator'), + ); + $tests['UpdateFeedTestCase'] = array( + 'name' => t('Update feed functionality'), + 'description' => t('Update feed test.'), + 'group' => t('Aggregator'), + ); + $tests['RemoveFeedTestCase'] = array( + 'name' => t('Remove feed functionality'), + 'description' => t('Remove feed test.'), + 'group' => t('Aggregator'), + ); + $tests['UpdateFeedItemTestCase'] = array( + 'name' => t('Update feed item functionality'), + 'description' => t('Update feed items from a feed.'), + 'group' => t('Aggregator'), + ); + $tests['RemoveFeedItemTestCase'] = array( + 'name' => t('Remove feed item functionality'), + 'description' => t('Remove feed items from a feed.'), + 'group' => t('Aggregator'), + ); + $tests['CategorizeFeedItemTestCase'] = array( + 'name' => t('Categorize feed item functionality'), + 'description' => t('Test feed item categorization.'), + 'group' => t('Aggregator'), + ); + $tests['ImportOPMLTestCase'] = array( + 'name' => t('Import feeds from OPML functionality'), + 'description' => t('Test OPML import.'), + 'group' => t('Aggregator'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function aggregator_help($path, $arg) { Index: modules/aggregator/aggregator.test =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v retrieving revision 1.18 diff -u -r1.18 aggregator.test --- modules/aggregator/aggregator.test 22 Jan 2009 12:59:32 -0000 1.18 +++ modules/aggregator/aggregator.test 20 Feb 2009 03:14:43 -0000 @@ -236,13 +236,6 @@ } class AddFeedTestCase extends AggregatorTestCase { - function getInfo() { - return array( - 'name' => t('Add feed functionality'), - 'description' => t('Add feed test.'), - 'group' => t('Aggregator') - ); - } /** * Create a feed, ensure that it is unique, check the source, and delete the feed. @@ -265,13 +258,6 @@ } class UpdateFeedTestCase extends AggregatorTestCase { - function getInfo() { - return array( - 'name' => t('Update feed functionality'), - 'description' => t('Update feed test.'), - 'group' => t('Aggregator') - ); - } /** * Create a feed and attempt to update it. @@ -307,13 +293,6 @@ } class RemoveFeedTestCase extends AggregatorTestCase { - function getInfo() { - return array( - 'name' => t('Remove feed functionality'), - 'description' => t('Remove feed test.'), - 'group' => t('Aggregator') - ); - } /** * Remove a feed and ensure that all it services are removed. @@ -335,13 +314,6 @@ } class UpdateFeedItemTestCase extends AggregatorTestCase { - function getInfo() { - return array( - 'name' => t('Update feed item functionality'), - 'description' => t('Update feed items from a feed.'), - 'group' => t('Aggregator') - ); - } /** * Test running "update items" from the 'admin/content/aggregator' page. @@ -395,13 +367,6 @@ } class RemoveFeedItemTestCase extends AggregatorTestCase { - function getInfo() { - return array( - 'name' => t('Remove feed item functionality'), - 'description' => t('Remove feed items from a feed.'), - 'group' => t('Aggregator') - ); - } /** * Test running "remove items" from the 'admin/content/aggregator' page. @@ -425,14 +390,6 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase { private static $prefix = 'simpletest_aggregator_'; - function getInfo() { - return array( - 'name' => t('Categorize feed item functionality'), - 'description' => t('Test feed item categorization.'), - 'group' => t('Aggregator') - ); - } - /** * If a feed has a category, make sure that the children inherit that * categorization. @@ -484,14 +441,6 @@ class ImportOPMLTestCase extends AggregatorTestCase { private static $prefix = 'simpletest_aggregator_'; - function getInfo() { - return array( - 'name' => t('Import feeds from OPML functionality'), - 'description' => t('Test OPML import.'), - 'group' => t('Aggregator'), - ); - } - /** * Open OPML import form. */ Index: modules/comment/comment.test =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v retrieving revision 1.25 diff -u -r1.25 comment.test --- modules/comment/comment.test 7 Feb 2009 20:10:40 -0000 1.25 +++ modules/comment/comment.test 20 Feb 2009 03:14:45 -0000 @@ -229,13 +229,6 @@ } class CommentInterfaceTest extends CommentHelperCase { - function getInfo() { - return array( - 'name' => t('Comment interface'), - 'description' => t('Test comment user interfaces.'), - 'group' => t('Comment'), - ); - } /** * Test comment interface. @@ -359,13 +352,6 @@ } class CommentAnonymous extends CommentHelperCase { - function getInfo() { - return array( - 'name' => t('Anonymous comments'), - 'description' => t('Test anonymous comments.'), - 'group' => t('Comment'), - ); - } /** * Test anonymous comment functionality. @@ -455,13 +441,6 @@ } class CommentApprovalTest extends CommentHelperCase { - function getInfo() { - return array( - 'name' => t('Comment approval'), - 'description' => t('Test comment approval functionality.'), - 'group' => t('Comment'), - ); - } /** * Test comment approval functionality through admin/content/comment. @@ -537,13 +516,6 @@ * Functional tests for the comment module blocks. */ class CommentBlockFunctionalTest extends CommentHelperCase { - function getInfo() { - return array( - 'name' => t('Comment blocks'), - 'description' => t('Test comment block functionality.'), - 'group' => t('Comment'), - ); - } /** * Test the recent comments block. @@ -592,13 +564,6 @@ * Unit tests for comment module integration with RSS feeds. */ class CommentRSSUnitTest extends CommentHelperCase { - function getInfo() { - return array( - 'name' => t('Comment RSS'), - 'description' => t('Test comments as part of an RSS feed.'), - 'group' => t('Comment'), - ); - } /** * Test comments as part of an RSS feed. Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.693 diff -u -r1.693 comment.module --- modules/comment/comment.module 18 Feb 2009 15:19:55 -0000 1.693 +++ modules/comment/comment.module 20 Feb 2009 03:14:45 -0000 @@ -91,6 +91,41 @@ define('COMMENT_PREVIEW_REQUIRED', 1); /** + * Implementation of hook_test(). + */ +function comment_test() { + $tests = array(); + + $tests['CommentInterfaceTest'] = array( + 'name' => t('Comment interface'), + 'description' => t('Test comment user interfaces.'), + 'group' => t('Comment'), + ); + $tests['CommentAnonymous'] = array( + 'name' => t('Anonymous comments'), + 'description' => t('Test anonymous comments.'), + 'group' => t('Comment'), + ); + $tests['CommentApprovalTest'] = array( + 'name' => t('Comment approval'), + 'description' => t('Test comment approval functionality.'), + 'group' => t('Comment'), + ); + $tests['CommentBlockFunctionalTest'] = array( + 'name' => t('Comment blocks'), + 'description' => t('Test comment block functionality.'), + 'group' => t('Comment'), + ); + $tests['CommentRSSUnitTest'] = array( + 'name' => t('Comment RSS'), + 'description' => t('Test comments as part of an RSS feed.'), + 'group' => t('Comment'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function comment_help($path, $arg) { Index: modules/syslog/syslog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/syslog/syslog.module,v retrieving revision 1.21 diff -u -r1.21 syslog.module --- modules/syslog/syslog.module 21 Jan 2009 14:22:32 -0000 1.21 +++ modules/syslog/syslog.module 20 Feb 2009 03:14:55 -0000 @@ -14,6 +14,21 @@ } /** + * Implementation of hook_test(). + */ +function syslog_test() { + $tests = array(); + + $tests['SyslogTestCase'] = array( + 'name' => t('Syslog functionality'), + 'description' => t('Test syslog settings.'), + 'group' => t('Syslog'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function syslog_help($path, $arg) { Index: modules/syslog/syslog.test =================================================================== RCS file: /cvs/drupal/drupal/modules/syslog/syslog.test,v retrieving revision 1.5 diff -u -r1.5 syslog.test --- modules/syslog/syslog.test 25 Nov 2008 13:14:28 -0000 1.5 +++ modules/syslog/syslog.test 20 Feb 2009 03:14:55 -0000 @@ -2,13 +2,6 @@ // $Id: syslog.test,v 1.5 2008/11/25 13:14:28 dries Exp $ class SyslogTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Syslog functionality'), - 'description' => t('Test syslog settings.'), - 'group' => t('Syslog') - ); - } function setUp() { parent::setUp('syslog'); Index: modules/help/help.test =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.test,v retrieving revision 1.4 diff -u -r1.4 help.test --- modules/help/help.test 11 Dec 2008 20:35:37 -0000 1.4 +++ modules/help/help.test 20 Feb 2009 03:14:48 -0000 @@ -5,14 +5,6 @@ protected $big_user; protected $any_user; - function getInfo() { - return array( - 'name' => t('Help functionality'), - 'description' => t('Verify help display and user access to help based on persmissions.'), - 'group' => t('Help'), - ); - } - /** * Enable modules and create users with specific permissions. */ Index: modules/help/help.module =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.module,v retrieving revision 1.81 diff -u -r1.81 help.module --- modules/help/help.module 6 May 2008 12:18:47 -0000 1.81 +++ modules/help/help.module 20 Feb 2009 03:14:48 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function help_test() { + $tests = array(); + + $tests['HelpTestCase'] = array( + 'name' => t('Help functionality'), + 'description' => t('Verify help display and user access to help based on persmissions.'), + 'group' => t('Help'), + ); + + return $tests; +} + +/** * Implementation of hook_menu(). */ function help_menu() { Index: modules/simpletest/tests/graph.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/graph.test,v retrieving revision 1.1 diff -u -r1.1 graph.test --- modules/simpletest/tests/graph.test 14 Jan 2009 12:18:37 -0000 1.1 +++ modules/simpletest/tests/graph.test 20 Feb 2009 03:14:55 -0000 @@ -10,13 +10,6 @@ * Unit tests for the graph handling features. */ class GraphUnitTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Graph'), - 'description' => t('Graph handling unit tests.'), - 'group' => t('System'), - ); - } /** * Test depth-first-search features. Index: modules/simpletest/tests/common.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v retrieving revision 1.29 diff -u -r1.29 common.test --- modules/simpletest/tests/common.test 18 Feb 2009 13:46:54 -0000 1.29 +++ modules/simpletest/tests/common.test 20 Feb 2009 03:14:55 -0000 @@ -6,14 +6,6 @@ */ class CommonLUnitTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Tests for the l() function'), - 'description' => t('Confirm that url() works correctly with various input.'), - 'group' => t('System'), - ); - } - /** * Confirm that invalid text given as $path is filtered. */ @@ -30,14 +22,6 @@ protected $exact_test_cases; protected $rounded_test_cases; - function getInfo() { - return array( - 'name' => t('Size parsing test'), - 'description' => t('Parse a predefined amount of bytes and compare the output with the expected value.'), - 'group' => t('System') - ); - } - function setUp() { $kb = DRUPAL_KILOBYTE; $this->exact_test_cases = array( @@ -134,14 +118,6 @@ '"Drupal, although it rhymes with sloopal, is as awesome as a troopal!"' => 'Drupal, although it rhymes with sloopal, is as awesome as a troopal!', ); - function getInfo() { - return array( - 'name' => t('Drupal tags handling'), - 'description' => t("Performs tests on Drupal's handling of tags, both explosion and implosion tactics used."), - 'group' => t('System') - ); - } - /** * Explode a series of tags. */ @@ -184,13 +160,6 @@ * Test the Drupal CSS system. */ class CascadingStylesheetsTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Cascading stylesheets'), - 'description' => t('Tests adding various cascading stylesheets to the page.'), - 'group' => t('System') - ); - } function setUp() { parent::setUp(); @@ -236,13 +205,6 @@ * Test drupal_http_request(). */ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Drupal HTTP request'), - 'description' => t("Performs tests on Drupal's HTTP request mechanism."), - 'group' => t('System') - ); - } function setUp() { parent::setUp('system_test'); @@ -317,13 +279,6 @@ * Testing drupal_set_content and drupal_get_content. */ class DrupalSetContentTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Drupal set/get content'), - 'description' => t('Performs tests on setting and retrieiving content from theme regions.'), - 'group' => t('System') - ); - } /** @@ -368,14 +323,6 @@ */ var $preprocess_js = NULL; - function getInfo() { - return array( - 'name' => t('JavaScript'), - 'description' => t('Tests the JavaScript system.'), - 'group' => t('System') - ); - } - function setUp() { // Enable Locale and SimpleTest in the test environment. parent::setUp('locale', 'simpletest'); @@ -509,13 +456,6 @@ * Tests for drupal_render(). */ class DrupalRenderUnitTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Drupal render'), - 'description' => t('Performs unit tests on drupal_render().'), - 'group' => t('System'), - ); - } /** * Test sorting by weight. @@ -574,13 +514,6 @@ * Tests Drupal error and exception handlers. */ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Drupal error handlers'), - 'description' => t('Performs tests on the Drupal error and exception handler.'), - 'group' => t('System'), - ); - } function setUp() { parent::setUp('system_test'); @@ -686,13 +619,6 @@ * Test for valid_url(). */ class ValidUrlTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Valid Url'), - 'description' => t("Performs tests on Drupal's valid url function."), - 'group' => t('System') - ); - } /** * Test valid absolute urls. @@ -794,13 +720,6 @@ * Tests for CRUD API functions. */ class DrupalDataApiTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Data API functions'), - 'description' => t('Tests the performance of CRUD APIs.'), - 'group' => t('System'), - ); - } function setUp() { parent::setUp('taxonomy'); @@ -851,14 +770,6 @@ */ protected $collectedErrors = array(); - function getInfo() { - return array( - 'name' => t('SimpleTest error collecter'), - 'description' => t('Performs tests on the Simpletest error and exception collecter.'), - 'group' => t('SimpleTest'), - ); - } - function setUp() { parent::setUp('system_test'); } Index: modules/simpletest/tests/actions.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/actions.test,v retrieving revision 1.2 diff -u -r1.2 actions.test --- modules/simpletest/tests/actions.test 25 Nov 2008 13:14:28 -0000 1.2 +++ modules/simpletest/tests/actions.test 20 Feb 2009 03:14:51 -0000 @@ -2,13 +2,6 @@ // $Id: actions.test,v 1.2 2008/11/25 13:14:28 dries Exp $ class ActionsConfigurationTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Actions configuration'), - 'description' => t('Tests complex actions configuration by adding, editing, and deleting a complex action.'), - 'group' => t('System'), - ); - } /** * Test the configuration of advanced actions through the administration Index: modules/simpletest/tests/database_test.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.test,v retrieving revision 1.40 diff -u -r1.40 database_test.test --- modules/simpletest/tests/database_test.test 18 Feb 2009 15:19:56 -0000 1.40 +++ modules/simpletest/tests/database_test.test 20 Feb 2009 03:14:55 -0000 @@ -137,14 +137,6 @@ */ class DatabaseConnectionTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Connection tests'), - 'description' => t('Tests of the core database system.'), - 'group' => t('Database'), - ); - } - /** * Test that connections return appropriate connection objects. */ @@ -205,14 +197,6 @@ */ class DatabaseFetchTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Fetch tests'), - 'description' => t('Test the Database system\'s various fetch capabilities.'), - 'group' => t('Database'), - ); - } - /** * Confirm that we can fetch a record properly in default object mode. */ @@ -286,14 +270,6 @@ */ class DatabaseFetch2TestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Fetch tests, part 2'), - 'description' => t('Test the Database system\'s various fetch capabilities.'), - 'group' => t('Database'), - ); - } - function setUp() { parent::setUp(); } @@ -351,14 +327,6 @@ */ class DatabaseInsertTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Insert tests'), - 'description' => t('Test the Insert query builder.'), - 'group' => t('Database'), - ); - } - /** * Test the very basic insert functionality. */ @@ -485,14 +453,6 @@ */ class DatabaseInsertLOBTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Insert tests, LOB fields'), - 'description' => t('Test the Insert query builder with LOB fields.'), - 'group' => t('Database'), - ); - } - /** * Test that we can insert a single blob field successfully. */ @@ -525,14 +485,6 @@ */ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Insert tests, default fields'), - 'description' => t('Test the Insert query builder with default values.'), - 'group' => t('Database'), - ); - } - /** * Test that we can run a query that is "default values for everything". */ @@ -578,14 +530,6 @@ */ class DatabaseUpdateTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Update tests'), - 'description' => t('Test the Update query builder.'), - 'group' => t('Database'), - ); - } - /** * Confirm that we can update a single record successfully. */ @@ -648,14 +592,6 @@ */ class DatabaseUpdateComplexTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Update tests, Complex'), - 'description' => t('Test the Update query builder, complex queries.'), - 'group' => t('Database'), - ); - } - /** * Test updates with OR conditionals. */ @@ -769,14 +705,6 @@ */ class DatabaseUpdateLOBTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Update tests, LOB'), - 'description' => t('Test the Update query builder with LOB fields.'), - 'group' => t('Database'), - ); - } - /** * Confirm that we can update a blob column. */ @@ -821,14 +749,6 @@ */ class DatabaseDeleteTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Delete tests'), - 'description' => t('Test the Delete query builder.'), - 'group' => t('Database'), - ); - } - /** * Confirm that we can delete a single record successfully. */ @@ -848,14 +768,6 @@ */ class DatabaseMergeTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Merge tests'), - 'description' => t('Test the Merge query builder.'), - 'group' => t('Database'), - ); - } - /** * Confirm that we can merge-insert a record successfully. */ @@ -985,14 +897,6 @@ */ class DatabaseSelectTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Select tests'), - 'description' => t('Test the Select query builder.'), - 'group' => t('Database'), - ); - } - /** * Test rudimentary SELECT statements. */ @@ -1124,14 +1028,6 @@ */ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Select tests, subqueries'), - 'description' => t('Test the Select query builder.'), - 'group' => t('Database'), - ); - } - /** * Test that we can use a subquery in a FROM clause. */ @@ -1190,14 +1086,6 @@ */ class DatabaseSelectOrderedTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Select tests, ordered'), - 'description' => t('Test the Select query builder.'), - 'group' => t('Database'), - ); - } - /** * Test basic order by. */ @@ -1277,14 +1165,6 @@ */ class DatabaseSelectComplexTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Select tests, complex'), - 'description' => t('Test the Select query builder with more complex queries.'), - 'group' => t('Database'), - ); - } - /** * Test simple JOIN statements. */ @@ -1486,14 +1366,6 @@ */ class DatabaseTaggingTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Query tagging tests'), - 'description' => t('Test the tagging capabilities of the Select builder.'), - 'group' => t('Database'), - ); - } - /** * Confirm that a query has a "tag" added to it. */ @@ -1569,14 +1441,6 @@ */ class DatabaseAlterTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Query altering tests'), - 'description' => t('Test the hook_query_alter capabilities of the Select builder.'), - 'group' => t('Database'), - ); - } - /** * Test that we can do basic alters. */ @@ -1653,14 +1517,6 @@ */ class DatabaseAlter2TestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Query altering tests, part 2'), - 'description' => t('Test the hook_query_alter capabilities of the Select builder.'), - 'group' => t('Database'), - ); - } - /** * Test that we can alter the fields of a query. */ @@ -1715,14 +1571,6 @@ */ class DatabaseRegressionTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Regression tests'), - 'description' => t('Regression tests cases for the database layer.'), - 'group' => t('Database'), - ); - } - /** * Regression test for #310447. * @@ -1765,14 +1613,6 @@ */ class DatabaseLoggingTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Query logging'), - 'description' => t('Test the query logging facility.'), - 'group' => t('Database'), - ); - } - /** * Test that we can log the existence of a query. */ @@ -1890,13 +1730,6 @@ * Range query tests. */ class DatabaseRangeQueryTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Range query test'), - 'description' => t('Test the Range query functionality.'), - 'group' => t('Database'), - ); - } function setUp() { parent::setUp('database_test'); @@ -1921,13 +1754,6 @@ * Temporary query tests. */ class DatabaseTemporaryQueryTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Temporary query test'), - 'description' => t('Test the temporary query functionality.'), - 'group' => t('Database'), - ); - } function setUp() { parent::setUp('database_test'); @@ -1971,13 +1797,6 @@ * database system interprets SQL syntax in an expected fashion. */ class DatabaseAnsiSyntaxTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('ANSI SQL syntax tests'), - 'description' => t('Test ANSI SQL syntax interpretation.'), - 'group' => t('Database'), - ); - } function setUp() { parent::setUp('database_test'); @@ -2012,13 +1831,6 @@ * Test invalid data handling. */ class DatabaseInvalidDataTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('SQL handling tests'), - 'description' => t('Test handling of invalid data.'), - 'group' => t('Database'), - ); - } function setUp() { parent::setUp('database_test'); @@ -2128,13 +1940,6 @@ * Drupal-specific SQL syntax tests. */ class DatabaseQueryTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Custom query syntax tests'), - 'description' => t('Test Drupal\'s extended prepared statement syntax..'), - 'group' => t('Database'), - ); - } function setUp() { parent::setUp('database_test'); @@ -2172,14 +1977,6 @@ */ class DatabaseTransactionTestCase extends DatabaseTestCase { - function getInfo() { - return array( - 'name' => t('Transaction tests'), - 'description' => t('Test the transaction abstraction system.'), - 'group' => t('Database'), - ); - } - /** * Helper method for transaction unit test. This "outer layer" transaction * starts and then encapsulates the "inner layer" transaction. This nesting Index: modules/simpletest/tests/form.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v retrieving revision 1.3 diff -u -r1.3 form.test --- modules/simpletest/tests/form.test 28 Jan 2009 07:43:26 -0000 1.3 +++ modules/simpletest/tests/form.test 20 Feb 2009 03:14:55 -0000 @@ -8,14 +8,6 @@ class FormsTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Required field validation'), - 'description' => t('Carriage returns, tabs, and spaces are not valid content for a required field.'), - 'group' => t('Form API'), - ); - } - /** * Check several empty values for required forms elements. * @@ -77,13 +69,6 @@ * Test form type functions for expected behavior. */ class FormsTestTypeCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Form type-specific tests'), - 'description' => t('Test form type functions for expected behavior.'), - 'group' => t('Form API'), - ); - } /** * Test form_type_checkbox_value() function for expected behavior. @@ -115,14 +100,6 @@ */ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Tableselect form element type test'), - 'description' => t('Test the tableselect element for expected behavior'), - 'group' => t('Form API'), - ); - } - function setUp() { parent::setUp('form_test'); } Index: modules/simpletest/tests/unicode.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/unicode.test,v retrieving revision 1.2 diff -u -r1.2 unicode.test --- modules/simpletest/tests/unicode.test 2 Jan 2009 22:09:53 -0000 1.2 +++ modules/simpletest/tests/unicode.test 20 Feb 2009 03:14:55 -0000 @@ -18,14 +18,6 @@ */ protected $extendedMode = FALSE; - function getInfo() { - return array( - 'name' => t('Unicode handling'), - 'description' => t('Tests Drupal Unicode handling.'), - 'group' => t('System'), - ); - } - /** * Test full unicode features implemented using the mbstring extension. */ Index: modules/simpletest/tests/menu.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v retrieving revision 1.6 diff -u -r1.6 menu.test --- modules/simpletest/tests/menu.test 5 Feb 2009 01:05:17 -0000 1.6 +++ modules/simpletest/tests/menu.test 20 Feb 2009 03:14:55 -0000 @@ -7,13 +7,6 @@ */ class MenuIncTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Hook menu tests'), - 'description' => t('Test menu hook functionality.'), - 'group' => t('Menu'), - ); - } function setUp() { // Enable dummy module that implements hook_menu. @@ -53,13 +46,6 @@ * Tests rebuilding the menu by setting 'menu_rebuild_needed.' */ class MenuRebuildTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Menu rebuild test'), - 'description' => t('Test rebuilding of menu.'), - 'group' => t('Menu'), - ); - } /** * Test if the 'menu_rebuild_needed' variable triggers a menu_rebuild() call. Index: modules/simpletest/tests/registry.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/registry.test,v retrieving revision 1.5 diff -u -r1.5 registry.test --- modules/simpletest/tests/registry.test 8 Dec 2008 21:41:54 -0000 1.5 +++ modules/simpletest/tests/registry.test 20 Feb 2009 03:14:55 -0000 @@ -2,13 +2,6 @@ // $Id: registry.test,v 1.5 2008/12/08 21:41:54 dries Exp $ class RegistryParseFileTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Registry parse file test'), - 'description' => t('Parse a simple file and check that its resources are saved to the database.'), - 'group' => t('System') - ); - } function setUp() { $this->fileName = 'registry_test_' . md5(rand()); @@ -51,14 +44,6 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { protected $fileTypes = array('new', 'existing_changed'); - function getInfo() { - return array( - 'name' => t('Registry parse files test'), - 'description' => t('Read two a simple files from disc, and check that their resources are saved to the database.'), - 'group' => t('System') - ); - } - function setUp() { parent::setUp(); // Create files with some php to parse - one 'new', one 'existing' so Index: modules/simpletest/tests/file.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v retrieving revision 1.24 diff -u -r1.24 file.test --- modules/simpletest/tests/file.test 18 Feb 2009 15:07:27 -0000 1.24 +++ modules/simpletest/tests/file.test 20 Feb 2009 03:14:55 -0000 @@ -249,13 +249,6 @@ * This will run tests against the file_space_used() function. */ class FileSpaceUsedTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('File space used tests'), - 'description' => t('Tests the file_space_used() function.'), - 'group' => t('File'), - ); - } function setUp() { parent::setUp(); @@ -309,13 +302,6 @@ * This will run tests against the file validation functions (file_validate_*). */ class FileValidatorTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('File validator tests'), - 'description' => t('Tests the functions used to validate uploaded files.'), - 'group' => t('File'), - ); - } function setUp() { parent::setUp(); @@ -467,13 +453,6 @@ * Tests the file_unmanaged_save_data() function. */ class FileUnmanagedSaveDataTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('Unmanaged file save data'), - 'description' => t('Tests the unmanaged file save data function.'), - 'group' => t('File'), - ); - } /** * Test the file_unmanaged_save_data() function. @@ -511,14 +490,6 @@ */ var $maxFidBefore; - function getInfo() { - return array( - 'name' => t('File uploading'), - 'description' => t('Tests the file uploading functions.'), - 'group' => t('File'), - ); - } - function setUp() { parent::setUp(); $account = $this->drupalCreateUser(array('access content')); @@ -639,13 +610,6 @@ * Directory related tests. */ class FileDirectoryTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('File paths and directories'), - 'description' => t('Tests operations dealing with directories.'), - 'group' => t('File'), - ); - } /** * Test the file_directory_path() function. @@ -804,13 +768,6 @@ * Tests the file_scan_directory() function. */ class FileScanDirectoryTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('File scan directory'), - 'description' => t('Tests the file_scan_directory() function.'), - 'group' => t('File'), - ); - } function setUp() { parent::setUp(); @@ -932,13 +889,6 @@ * Deletion related tests. */ class FileUnmanagedDeleteTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('Unmanaged file delete'), - 'description' => t('Tests the unmanaged file delete function.'), - 'group' => t('File'), - ); - } /** * Delete a normal file. @@ -978,13 +928,6 @@ * Deletion related tests. */ class FileUnmanagedDeleteRecursiveTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('Unmanaged recursive file delete'), - 'description' => t('Tests the unmanaged file delete recursive function.'), - 'group' => t('File'), - ); - } /** * Delete a normal file. @@ -1055,13 +998,6 @@ * Unmanaged move related tests. */ class FileUnmanagedMoveTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('Unmanaged file moving'), - 'description' => t('Tests the unmanaged file move function.'), - 'group' => t('File'), - ); - } /** * Move a normal file. @@ -1127,13 +1063,6 @@ * Unmanaged copy related tests. */ class FileUnmanagedCopyTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('Unmanaged file copying'), - 'description' => t('Tests the unmanaged file copy function.'), - 'group' => t('File'), - ); - } /** * Copy a normal file. @@ -1214,13 +1143,6 @@ * Deletion related tests. */ class FileDeleteTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File delete'), - 'description' => t('Tests the file delete function.'), - 'group' => t('File'), - ); - } /** * Try deleting a normal file (as opposed to a directory, symlink, etc). @@ -1245,13 +1167,6 @@ * Move related tests */ class FileMoveTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File moving'), - 'description' => t('Tests the file move function.'), - 'group' => t('File'), - ); - } /** * Move a normal file. @@ -1406,13 +1321,6 @@ * Copy related tests. */ class FileCopyTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File copying'), - 'description' => t('Tests the file copy function.'), - 'group' => t('File'), - ); - } /** * Test file copying in the normal, base case. @@ -1552,13 +1460,6 @@ * Tests the file_load() function. */ class FileLoadTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File loading'), - 'description' => t('Tests the file_load() function.'), - 'group' => t('File'), - ); - } /** * Try to load a non-existent file by fid. @@ -1649,13 +1550,6 @@ * Tests the file_save() function. */ class FileSaveTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File saving'), - 'description' => t('Tests the file_save() function.'), - 'group' => t('File'), - ); - } function testFileSave() { // Create a new file object. @@ -1705,13 +1599,6 @@ * Tests the file_validate() function.. */ class FileValidateTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File validate'), - 'description' => t('Tests the file_validate() function.'), - 'group' => t('File'), - ); - } /** * Test that the validators passed into are checked. @@ -1744,13 +1631,6 @@ * Tests the file_save_data() function. */ class FileSaveDataTest extends FileHookTestCase { - function getInfo() { - return array( - 'name' => t('File save data'), - 'description' => t('Tests the file save data function.'), - 'group' => t('File'), - ); - } /** * Test the file_save_data() function when no filename is provided. @@ -1875,13 +1755,6 @@ * Tests for download/file transfer functions. */ class FileDownloadTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('File download'), - 'description' => t('Tests for file download/transfer functions.'), - 'group' => t('File'), - ); - } function setUp() { parent::setUp('file_test'); @@ -1921,13 +1794,6 @@ * Tests for file_munge_filename() and file_unmunge_filename(). */ class FileNameMungingTest extends FileTestCase { - function getInfo() { - return array( - 'name' => t('File naming'), - 'description' => t('Test filename munging and unmunging.'), - 'group' => t('File'), - ); - } function setUp() { parent::setUp(); Index: modules/simpletest/tests/schema.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/schema.test,v retrieving revision 1.3 diff -u -r1.3 schema.test --- modules/simpletest/tests/schema.test 16 Nov 2008 19:41:14 -0000 1.3 +++ modules/simpletest/tests/schema.test 20 Feb 2009 03:14:55 -0000 @@ -10,13 +10,6 @@ * Unit tests for the Schema API. */ class SchemaTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Schema API'), - 'description' => t('Tests table creation and modification via the schema API.'), - 'group' => t('Database'), - ); - } /** * Index: modules/simpletest/tests/module.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/module.test,v retrieving revision 1.1 diff -u -r1.1 module.test --- modules/simpletest/tests/module.test 3 Jan 2009 08:45:28 -0000 1.1 +++ modules/simpletest/tests/module.test 20 Feb 2009 03:14:55 -0000 @@ -10,13 +10,6 @@ * Unit tests for the module API. */ class ModuleUnitTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Module API'), - 'description' => t('Test low-level module functions.'), - 'group' => t('Module'), - ); - } /** * The basic functionality of module_list(). Index: modules/simpletest/tests/cache.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/cache.test,v retrieving revision 1.3 diff -u -r1.3 cache.test --- modules/simpletest/tests/cache.test 8 Dec 2008 21:41:54 -0000 1.3 +++ modules/simpletest/tests/cache.test 20 Feb 2009 03:14:51 -0000 @@ -102,13 +102,6 @@ } class CacheSavingCase extends CacheTestCase { - function getInfo() { - return array( - 'name' => t('Cache saving test'), - 'description' => t('Check our variables are saved and restored the right way.'), - 'group' => t('Cache') - ); - } /** * Test the saving and restoring of a string. @@ -163,13 +156,6 @@ } class CacheClearCase extends CacheTestCase { - function getInfo() { - return array( - 'name' => t('Cache clear test'), - 'description' => t('Check our clearing is done the proper way.'), - 'group' => t('Cache') - ); - } function setUp() { $this->default_table = 'cache_page'; Index: modules/simpletest/tests/bootstrap.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/bootstrap.test,v retrieving revision 1.12 diff -u -r1.12 bootstrap.test --- modules/simpletest/tests/bootstrap.test 31 Jan 2009 16:50:57 -0000 1.12 +++ modules/simpletest/tests/bootstrap.test 20 Feb 2009 03:14:51 -0000 @@ -3,14 +3,6 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('IP address and HTTP_HOST test'), - 'description' => t('Get the IP address from the current visitor from the server variables, check hostname validation.'), - 'group' => t('Bootstrap') - ); - } - function setUp() { $this->oldserver = $_SERVER; @@ -82,14 +74,6 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Page cache test'), - 'description' => t('Enable the page cache and test it with conditional HTTP requests.'), - 'group' => t('Bootstrap') - ); - } - /** * Enable cache and examine HTTP headers. */ @@ -136,14 +120,6 @@ parent::setUp('system_test'); } - function getInfo() { - return array( - 'name' => t('Variable test'), - 'description' => t('Make sure the variable system functions correctly.'), - 'group' => t('Bootstrap') - ); - } - /** * testVariable */ @@ -182,14 +158,6 @@ */ class HookBootExitTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Boot and exit hook invocation'), - 'description' => t('Test that hook_boot() and hook_exit() are called correctly.'), - 'group' => t('Bootstrap'), - ); - } - function setUp() { parent::setUp('system_test', 'dblog'); } Index: modules/simpletest/tests/xmlrpc.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/xmlrpc.test,v retrieving revision 1.6 diff -u -r1.6 xmlrpc.test --- modules/simpletest/tests/xmlrpc.test 30 Dec 2008 16:43:18 -0000 1.6 +++ modules/simpletest/tests/xmlrpc.test 20 Feb 2009 03:14:55 -0000 @@ -2,13 +2,6 @@ // $Id: xmlrpc.test,v 1.6 2008/12/30 16:43:18 dries Exp $ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('XML-RPC validator'), - 'description' => t('See !validator-link.', array('!validator-link' => l('the xmlrpc validator1 specification', 'http://www.xmlrpc.com/validator1Docs'))), - 'group' => t('XML-RPC'), - ); - } function setUp() { parent::setUp('xmlrpc_test'); @@ -122,13 +115,6 @@ } class XMLRPCMessagesTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('XML-RPC message'), - 'description' => t('Test large messages.'), - 'group' => t('XML-RPC'), - ); - } function setUp() { parent::setUp('xmlrpc_test'); Index: modules/simpletest/tests/session.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/session.test,v retrieving revision 1.10 diff -u -r1.10 session.test --- modules/simpletest/tests/session.test 19 Jan 2009 10:46:51 -0000 1.10 +++ modules/simpletest/tests/session.test 20 Feb 2009 03:14:55 -0000 @@ -7,13 +7,6 @@ */ class SessionTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Session tests'), - 'description' => t('Drupal session handling tests.'), - 'group' => t('Session') - ); - } function setUp() { parent::setUp('session_test'); Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.152 diff -u -r1.152 path.module --- modules/path/path.module 9 Dec 2008 11:30:24 -0000 1.152 +++ modules/path/path.module 20 Feb 2009 03:14:50 -0000 @@ -7,6 +7,26 @@ */ /** + * Implementation of hook_test(). + */ +function path_test() { + $tests = array(); + + $tests['PathTestCase'] = array( + 'name' => t('Path alias functionality'), + 'description' => t('Add, edit, delete, and change alias and verify its consistency in the database.'), + 'group' => t('Path'), + ); + $tests['PathLanguageTestCase'] = array( + 'name' => t('Path aliases with translated nodes'), + 'description' => t('Confirm that paths work with translated nodes'), + 'group' => t('Path'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function path_help($path, $arg) { Index: modules/path/path.test =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.test,v retrieving revision 1.6 diff -u -r1.6 path.test --- modules/path/path.test 9 Jan 2009 07:44:00 -0000 1.6 +++ modules/path/path.test 20 Feb 2009 03:14:50 -0000 @@ -2,13 +2,6 @@ // $Id: path.test,v 1.6 2009/01/09 07:44:00 dries Exp $ class PathTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Path alias functionality'), - 'description' => t('Add, edit, delete, and change alias and verify its consistency in the database.'), - 'group' => t('Path'), - ); - } /** * Create user, setup permissions, log user in, and create a node. @@ -126,13 +119,6 @@ } class PathLanguageTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Path aliases with translated nodes'), - 'description' => t('Confirm that paths work with translated nodes'), - 'group' => t('Path'), - ); - } /** * Create user, setup permissions, log user in, and create a node. Index: modules/contact/contact.test =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v retrieving revision 1.14 diff -u -r1.14 contact.test --- modules/contact/contact.test 30 Dec 2008 16:43:16 -0000 1.14 +++ modules/contact/contact.test 20 Feb 2009 03:14:45 -0000 @@ -5,13 +5,6 @@ * Test the sitewide contact form. */ class ContactSitewideTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Site-wide contact form'), - 'description' => t('Tests site-wide contact form functionality.'), - 'group' => t('Contact'), - ); - } function setUp() { parent::setUp('contact'); @@ -256,13 +249,6 @@ * Test the personal contact form. */ class ContactPersonalTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Personal contact form'), - 'description' => t('Tests personal contact form functionality.'), - 'group' => t('Contact'), - ); - } function setUp() { parent::setUp('contact'); Index: modules/contact/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v retrieving revision 1.111 diff -u -r1.111 contact.module --- modules/contact/contact.module 9 Oct 2008 15:15:51 -0000 1.111 +++ modules/contact/contact.module 20 Feb 2009 03:14:45 -0000 @@ -7,6 +7,26 @@ */ /** + * Implementation of hook_test(). + */ +function contact_test() { + $tests = array(); + + $tests['ContactSitewideTestCase'] = array( + 'name' => t('Site-wide contact form'), + 'description' => t('Tests site-wide contact form functionality.'), + 'group' => t('Contact'), + ); + $tests['ContactPersonalTestCase'] = array( + 'name' => t('Personal contact form'), + 'description' => t('Tests personal contact form functionality.'), + 'group' => t('Contact'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function contact_help($path, $arg) { Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.289 diff -u -r1.289 poll.module --- modules/poll/poll.module 18 Feb 2009 14:28:22 -0000 1.289 +++ modules/poll/poll.module 20 Feb 2009 03:14:50 -0000 @@ -8,6 +8,36 @@ */ /** + * Implementation of hook_test(). + */ +function poll_test() { + $tests = array(); + + $tests['PollCreateTestCase'] = array( + 'name' => t('Poll create'), + 'description' => t('Adds "more choices", previews and creates a poll.'), + 'group' => t('Poll'), + ); + $tests['PollVoteTestCase'] = array( + 'name' => t('Poll vote'), + 'description' => t('Vote on a poll'), + 'group' => t('Poll'), + ); + $tests['PollBlockTestCase'] = array( + 'name' => t('Block availability'), + 'description' => t('Check if the most recent poll block is available.'), + 'group' => t('Poll'), + ); + $tests['PollJSAddChoice'] = array( + 'name' => t('Poll add choice'), + 'description' => t('Submits a POST request for an additional poll choice.'), + 'group' => t('Poll'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function poll_help($path, $arg) { Index: modules/poll/poll.test =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v retrieving revision 1.15 diff -u -r1.15 poll.test --- modules/poll/poll.test 1 Feb 2009 06:48:15 -0000 1.15 +++ modules/poll/poll.test 20 Feb 2009 03:14:50 -0000 @@ -74,9 +74,6 @@ } class PollCreateTestCase extends PollTestCase { - function getInfo() { - return array('name' => t('Poll create'), 'description' => 'Adds "more choices", previews and creates a poll.', 'group' => t('Poll')); - } function setUp() { parent::setUp('poll'); @@ -90,9 +87,6 @@ } class PollVoteTestCase extends PollTestCase { - function getInfo() { - return array('name' => t('Poll vote'), 'description' => 'Vote on a poll', 'group' => t('Poll')); - } function setUp() { parent::setUp('poll'); @@ -125,13 +119,6 @@ } class PollBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block availability'), - 'description' => t('Check if the most recent poll block is available.'), - 'group' => t('Poll'), - ); - } function setUp() { parent::setUp('poll'); @@ -159,14 +146,6 @@ */ class PollJSAddChoice extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Poll add choice'), - 'description' => t('Submits a POST request for an additional poll choice.'), - 'group' => t('Poll') - ); - } - function setUp() { parent::setUp('poll'); } Index: modules/tracker/tracker.test =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.test,v retrieving revision 1.6 diff -u -r1.6 tracker.test --- modules/tracker/tracker.test 9 Feb 2009 16:27:35 -0000 1.6 +++ modules/tracker/tracker.test 20 Feb 2009 03:14:56 -0000 @@ -6,14 +6,6 @@ protected $other_user; protected $new_node; - function getInfo() { - return array( - 'name' => t('Tracker'), - 'description' => t('Create nodes and check for their display in the tracker listings.'), - 'group' => t('Tracker') - ); - } - function setUp() { parent::setUp('comment', 'tracker'); Index: modules/tracker/tracker.module =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v retrieving revision 1.157 diff -u -r1.157 tracker.module --- modules/tracker/tracker.module 6 May 2008 12:18:51 -0000 1.157 +++ modules/tracker/tracker.module 20 Feb 2009 03:14:56 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function tracker_test() { + $tests = array(); + + $tests['TrackerTest'] = array( + 'name' => t('Tracker'), + 'description' => t('Create nodes and check for their display in the tracker listings.'), + 'group' => t('Tracker'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function tracker_help($path, $arg) { Index: modules/user/user.test =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.test,v retrieving revision 1.28 diff -u -r1.28 user.test --- modules/user/user.test 9 Feb 2009 07:36:15 -0000 1.28 +++ modules/user/user.test 20 Feb 2009 03:14:58 -0000 @@ -2,13 +2,6 @@ // $Id: user.test,v 1.28 2009/02/09 07:36:15 webchick Exp $ class UserRegistrationTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('User registration'), - 'description' => t('Registers a user, fails login, resets password, successfully logs in with the one time password, changes password, logs out, successfully logs in with the new password, visits profile page.'), - 'group' => t('User') - ); - } /** * Registers a user, fails login, resets password, successfully logs in with the one time password, @@ -101,13 +94,6 @@ class UserValidationTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Username/e-mail validation'), - 'description' => t('Verify that username/email validity checks behave as designed.'), - 'group' => t('User') - ); - } // Username validation. function testUsernames() { @@ -152,13 +138,6 @@ } class UserCancelTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Cancel account'), - 'description' => t('Ensure that account cancellation methods work as expected.'), - 'group' => t('User'), - ); - } /** * Attempt to cancel account without permission. @@ -486,14 +465,6 @@ protected $user; protected $_directory_test; - function getInfo() { - return array( - 'name' => t('Upload user picture'), - 'description' => t('Assure that dimension check, extension check and image scaling work as designed.'), - 'group' => t('User') - ); - } - function setUp() { parent::setUp(); // Enable user pictures. @@ -704,14 +675,6 @@ protected $admin_user; protected $rid; - function getInfo() { - return array( - 'name' => t('Role permissions'), - 'description' => t('Verify that role permissions can be added and removed via the permissions page.'), - 'group' => t('User') - ); - } - function setUp() { parent::setUp(); @@ -751,13 +714,6 @@ } class UserAdminTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('User admininstration'), - 'description' => t('Test user admininstration page functionality.'), - 'group' => t('User') - ); - } /** * Registers a user and deletes it. @@ -804,13 +760,6 @@ * Tests for user-configurable time zones. */ class UserTimeZoneFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('User time zones'), - 'description' => t('Set a user time zone and verify that dates are displayed in local time.'), - 'group' => t('User'), - ); - } /** * Tests the display of dates and time when user-configurable time zones are set. @@ -864,13 +813,6 @@ * Test user autocompletion. */ class UserAutocompleteTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('User autocompletion'), - 'description' => t('Test user autocompletion functionality.'), - 'group' => t('User') - ); - } function setUp() { parent::setUp(); @@ -904,13 +846,6 @@ * Test user blocks. */ class UserBlocksUnitTests extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('User blocks'), - 'description' => t('Test user blocks.'), - 'group' => t('User') - ); - } /** * Test the Who's Online block. Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.965 diff -u -r1.965 user.module --- modules/user/user.module 19 Feb 2009 12:09:30 -0000 1.965 +++ modules/user/user.module 20 Feb 2009 03:14:58 -0000 @@ -16,6 +16,60 @@ */ define('EMAIL_MAX_LENGTH', 64); +/** + * Implementation of hook_test(). + */ +function user_test() { + $tests = array(); + + $tests['UserRegistrationTestCase'] = array( + 'name' => t('User registration'), + 'description' => t('Registers a user, fails login, resets password, successfully logs in with the one time password, changes password, logs out, successfully logs in with the new password, visits profile page.'), + 'group' => t('User'), + ); + $tests['UserValidationTestCase'] = array( + 'name' => t('Username/e-mail validation'), + 'description' => t('Verify that username/email validity checks behave as designed.'), + 'group' => t('User'), + ); + $tests['UserCancelTestCase'] = array( + 'name' => t('Cancel account'), + 'description' => t('Ensure that account cancellation methods work as expected.'), + 'group' => t('User'), + ); + $tests['UserPictureTestCase'] = array( + 'name' => t('Upload user picture'), + 'description' => t('Assure that dimension check, extension check and image scaling work as designed.'), + 'group' => t('User'), + ); + $tests['UserPermissionsTestCase'] = array( + 'name' => t('Role permissions'), + 'description' => t('Verify that role permissions can be added and removed via the permissions page.'), + 'group' => t('User'), + ); + $tests['UserAdminTestCase'] = array( + 'name' => t('User admininstration'), + 'description' => t('Test user admininstration page functionality.'), + 'group' => t('User'), + ); + $tests['UserTimeZoneFunctionalTest'] = array( + 'name' => t('User time zones'), + 'description' => t('Set a user time zone and verify that dates are displayed in local time.'), + 'group' => t('User'), + ); + $tests['UserAutocompleteTestCase'] = array( + 'name' => t('User autocompletion'), + 'description' => t('Test user autocompletion functionality.'), + 'group' => t('User'), + ); + $tests['UserBlocksUnitTests'] = array( + 'name' => t('User blocks'), + 'description' => t('Test user blocks.'), + 'group' => t('User'), + ); + + return $tests; +} /** * Invokes hook_user() in every module. Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.283 diff -u -r1.283 search.module --- modules/search/search.module 4 Jan 2009 16:10:48 -0000 1.283 +++ modules/search/search.module 20 Feb 2009 03:14:51 -0000 @@ -91,6 +91,41 @@ '\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}'); /** + * Implementation of hook_test(). + */ +function search_test() { + $tests = array(); + + $tests['SearchMatchTestCase'] = array( + 'name' => t('Search engine queries'), + 'description' => t('Indexes content and queries it.'), + 'group' => t('Search'), + ); + $tests['SearchBikeShed'] = array( + 'name' => t('Bike shed'), + 'description' => t('Tests the bike shed text on the no results page.'), + 'group' => t('Search'), + ); + $tests['SearchAdvancedSearchForm'] = array( + 'name' => t('Advanced search form'), + 'description' => t('Indexes content and tests the advanced search form.'), + 'group' => t('Search'), + ); + $tests['SearchRankingTestCase'] = array( + 'name' => t('Search engine ranking'), + 'description' => t('Indexes content and tests ranking factors.'), + 'group' => t('Search'), + ); + $tests['SearchBlockTestCase'] = array( + 'name' => t('Block availability'), + 'description' => t('Check if the search form block is available.'), + 'group' => t('Search'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function search_help($path, $arg) { Index: modules/search/search.test =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.test,v retrieving revision 1.15 diff -u -r1.15 search.test --- modules/search/search.test 22 Jan 2009 04:49:58 -0000 1.15 +++ modules/search/search.test 20 Feb 2009 03:14:51 -0000 @@ -7,13 +7,6 @@ define('SEARCH_TYPE_2', '_test2_'); class SearchMatchTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Search engine queries'), - 'description' => t('Indexes content and queries it.'), - 'group' => t('Search'), - ); - } /** * Implementation setUp(). @@ -197,14 +190,6 @@ class SearchBikeShed extends DrupalWebTestCase { protected $searching_user; - function getInfo() { - return array( - 'name' => t('Bike shed'), - 'description' => t('Tests the bike shed text on the no results page.'), - 'group' => t('Search') - ); - } - function setUp() { parent::setUp('search'); @@ -227,14 +212,6 @@ class SearchAdvancedSearchForm extends DrupalWebTestCase { protected $node; - function getInfo() { - return array( - 'name' => t('Advanced search form'), - 'description' => t('Indexes content and tests the advanced search form.'), - 'group' => t('Search'), - ); - } - function setUp() { parent::setUp('search'); // Create and login user. @@ -288,13 +265,6 @@ } class SearchRankingTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Search engine ranking'), - 'description' => t('Indexes content and tests ranking factors.'), - 'group' => t('Search'), - ); - } /** * Implementation setUp(). @@ -371,13 +341,6 @@ } class SearchBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block availability'), - 'description' => t('Check if the search form block is available.'), - 'group' => t('Search'), - ); - } function setUp() { parent::setUp('search'); Index: modules/blog/blog.test =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.test,v retrieving revision 1.6 diff -u -r1.6 blog.test --- modules/blog/blog.test 13 Feb 2009 02:22:09 -0000 1.6 +++ modules/blog/blog.test 20 Feb 2009 03:14:43 -0000 @@ -6,14 +6,6 @@ protected $own_user; protected $any_user; - function getInfo() { - return array( - 'name' => t('Blog functionality'), - 'description' => t('Create, view, edit, delete, and change blog entries and verify its consistency in the database.'), - 'group' => t('Blog'), - ); - } - /** * Enable modules and create users with specific permissions. */ Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.316 diff -u -r1.316 blog.module --- modules/blog/blog.module 31 Dec 2008 12:02:21 -0000 1.316 +++ modules/blog/blog.module 20 Feb 2009 03:14:43 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function blog_test() { + $tests = array(); + + $tests['BlogTestCase'] = array( + 'name' => t('Blog functionality'), + 'description' => t('Create, view, edit, delete, and change blog entries and verify its consistency in the database.'), + 'group' => t('Blog'), + ); + + return $tests; +} + +/** * Implementation of hook_node_info(). */ function blog_node_info() { Index: modules/field/modules/field_sql_storage/field_sql_storage.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.test,v retrieving revision 1.1 diff -u -r1.1 field_sql_storage.test --- modules/field/modules/field_sql_storage/field_sql_storage.test 3 Feb 2009 17:30:11 -0000 1.1 +++ modules/field/modules/field_sql_storage/field_sql_storage.test 20 Feb 2009 03:14:46 -0000 @@ -2,13 +2,6 @@ // $Id: field_sql_storage.test,v 1.1 2009/02/03 17:30:11 dries Exp $ class FieldSqlStorageTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Field SQL storage tests'), - 'description' => t("Test field SQL storage module."), - 'group' => t('Field') - ); - } function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); Index: modules/field/modules/field_sql_storage/field_sql_storage.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module,v retrieving revision 1.4 diff -u -r1.4 field_sql_storage.module --- modules/field/modules/field_sql_storage/field_sql_storage.module 10 Feb 2009 03:16:14 -0000 1.4 +++ modules/field/modules/field_sql_storage/field_sql_storage.module 20 Feb 2009 03:14:46 -0000 @@ -7,6 +7,22 @@ */ /** + * Implementation of hook_test(). + */ +function field_sql_storage_test() { + $tests = array(); + + $tests['FieldSqlStorageTestCase'] = array( + 'name' => t('Field SQL storage tests'), + 'description' => t("Test field SQL storage module."), + 'group' => t('Field'), + 'file' => 'field_sql_storage' + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function field_sql_storage_help($path, $arg) { Index: modules/block/block.test =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.test,v retrieving revision 1.11 diff -u -r1.11 block.test --- modules/block/block.test 11 Feb 2009 03:38:46 -0000 1.11 +++ modules/block/block.test 20 Feb 2009 03:14:43 -0000 @@ -4,14 +4,6 @@ class BlockTestCase extends DrupalWebTestCase { protected $regions; - function getInfo() { - return array( - 'name' => t('Block functionality'), - 'description' => t('Add, edit and delete custom block. Configure and move a module-defined block.'), - 'group' => t('Block'), - ); - } - function setUp() { parent::setUp(); @@ -152,13 +144,6 @@ } class NonDefaultBlockAdmin extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Non default theme admin'), - 'description' => t('Check the administer page for non default theme.'), - 'group' => t('Block'), - ); - } /** * Test non-default theme admin. Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.322 diff -u -r1.322 block.module --- modules/block/block.module 11 Feb 2009 05:33:18 -0000 1.322 +++ modules/block/block.module 20 Feb 2009 03:14:43 -0000 @@ -61,6 +61,26 @@ define('BLOCK_CACHE_GLOBAL', 0x0008); /** + * Implementation of hook_test(). + */ +function block_test() { + $tests = array(); + + $tests['BlockTestCase'] = array( + 'name' => t('Block functionality'), + 'description' => t('Add, edit and delete custom block. Configure and move a module-defined block.'), + 'group' => t('Block'), + ); + $tests['NonDefaultBlockAdmin'] = array( + 'name' => t('Non default theme admin'), + 'description' => t('Check the administer page for non default theme.'), + 'group' => t('Block'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function block_help($path, $arg) { Index: modules/menu/menu.test =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v retrieving revision 1.5 diff -u -r1.5 menu.test --- modules/menu/menu.test 29 Nov 2008 09:33:51 -0000 1.5 +++ modules/menu/menu.test 20 Feb 2009 03:14:48 -0000 @@ -7,14 +7,6 @@ protected $menu; protected $items; - function getInfo() { - return array( - 'name' => t('Menu item creation/deletion'), - 'description' => t('Add a custom menu, add menu items to the custom menu and Navigation menu, check their data, and delete them using the menu module UI.'), - 'group' => t('Menu') - ); - } - function setUp() { parent::setUp('menu'); // Create users. Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.178 diff -u -r1.178 menu.module --- modules/menu/menu.module 31 Jan 2009 16:56:00 -0000 1.178 +++ modules/menu/menu.module 20 Feb 2009 03:14:48 -0000 @@ -13,6 +13,21 @@ define('MENU_MAX_MENU_NAME_LENGTH_UI', 27); /** + * Implementation of hook_test(). + */ +function menu_test() { + $tests = array(); + + $tests['MenuTestCase'] = array( + 'name' => t('Menu item creation/deletion'), + 'description' => t('Add a custom menu, add menu items to the custom menu and Navigation menu, check their data, and delete them using the menu module UI.'), + 'group' => t('Menu'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function menu_help($path, $arg) { Index: modules/node/node.test =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.test,v retrieving revision 1.16 diff -u -r1.16 node.test --- modules/node/node.test 28 Jan 2009 07:34:30 -0000 1.16 +++ modules/node/node.test 20 Feb 2009 03:14:50 -0000 @@ -6,14 +6,6 @@ */ class NodeLoadMultipleUnitTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Load multiple nodes'), - 'description' => t('Test the loading of multiple nodes.'), - 'group' => t('Node'), - ); - } - function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('create article content', 'create page content')); @@ -85,14 +77,6 @@ protected $nodes; protected $logs; - function getInfo() { - return array( - 'name' => t('Node revisions'), - 'description' => t('Create a node with revisions and test viewing, reverting, and deleting revisions.'), - 'group' => t('Node'), - ); - } - function setUp() { parent::setUp(); @@ -167,13 +151,6 @@ } class NodeTeaserTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node teaser'), - 'description' => t('Test node_teaser() with different strings and lengths.'), - 'group' => t('Node'), - ); - } /** * Tests an edge case where if the first sentence is a question and @@ -312,13 +289,6 @@ } class PageEditTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node edit'), - 'description' => t('Create a node and test node edit functionality.'), - 'group' => t('Node'), - ); - } function setUp() { parent::setUp(); @@ -366,13 +336,6 @@ } class PagePreviewTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node preview'), - 'description' => t('Test node preview functionality.'), - 'group' => t('Node'), - ); - } function setUp() { parent::setUp(); @@ -403,13 +366,6 @@ } class PageCreationTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node creation'), - 'description' => t('Create a node and test saving it.'), - 'group' => t('Node'), - ); - } function setUp() { parent::setUp(); @@ -438,13 +394,6 @@ } class PageViewTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node edit permissions'), - 'description' => t('Create a node and test edit permissions.'), - 'group' => t('Node'), - ); - } /** * Creates a node and then an anonymous and unpermissioned user attempt to edit the node. @@ -477,13 +426,6 @@ } class NodeTitleXSSTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node title XSS filtering'), - 'description' => t('Create a node with dangerous tags in its title and test that they are escaped.'), - 'group' => t('Node'), - ); - } function testNodeTitleXSS() { // Prepare a user to do the stuff. @@ -509,13 +451,6 @@ } class NodeBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block availability'), - 'description' => t('Check if the syndicate block is available.'), - 'group' => t('Node'), - ); - } function setUp() { parent::setUp(); @@ -542,13 +477,6 @@ * Check that the post information displays when enabled for a content type. */ class NodePostSettingsTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node post information display'), - 'description' => t('Check that the post information (submitted by Username on date) text displays appropriately.'), - 'group' => t('Node'), - ); - } function setUp() { parent::setUp(); @@ -608,13 +536,6 @@ * sitewide RSS feed at rss.xml. */ class NodeRSSContentTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Node RSS Content'), - 'description' => t('Ensure that data added to nodes by other modules appears in RSS feeds.'), - 'group' => t('Node'), - ); - } function setUp() { // Enable dummy module that implements hook_nodeapi_view. Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1025 diff -u -r1.1025 node.module --- modules/node/node.module 18 Feb 2009 15:19:56 -0000 1.1025 +++ modules/node/node.module 20 Feb 2009 03:14:49 -0000 @@ -46,6 +46,71 @@ define('NODE_BUILD_PRINT', 5); /** + * Implementation of hook_test(). + */ +function node_test() { + $tests = array(); + + $tests['NodeLoadMultipleUnitTest'] = array( + 'name' => t('Load multiple nodes'), + 'description' => t('Test the loading of multiple nodes.'), + 'group' => t('Node'), + ); + $tests['NodeRevisionsTestCase'] = array( + 'name' => t('Node revisions'), + 'description' => t('Create a node with revisions and test viewing, reverting, and deleting revisions.'), + 'group' => t('Node'), + ); + $tests['NodeTeaserTestCase'] = array( + 'name' => t('Node teaser'), + 'description' => t('Test node_teaser() with different strings and lengths.'), + 'group' => t('Node'), + ); + $tests['PageEditTestCase'] = array( + 'name' => t('Node edit'), + 'description' => t('Create a node and test node edit functionality.'), + 'group' => t('Node'), + ); + $tests['PagePreviewTestCase'] = array( + 'name' => t('Node preview'), + 'description' => t('Test node preview functionality.'), + 'group' => t('Node'), + ); + $tests['PageCreationTestCase'] = array( + 'name' => t('Node creation'), + 'description' => t('Create a node and test saving it.'), + 'group' => t('Node'), + ); + $tests['PageViewTestCase'] = array( + 'name' => t('Node edit permissions'), + 'description' => t('Create a node and test edit permissions.'), + 'group' => t('Node'), + ); + $tests['NodeTitleXSSTestCase'] = array( + 'name' => t('Node title XSS filtering'), + 'description' => t('Create a node with dangerous tags in its title and test that they are escaped.'), + 'group' => t('Node'), + ); + $tests['NodeBlockTestCase'] = array( + 'name' => t('Block availability'), + 'description' => t('Check if the syndicate block is available.'), + 'group' => t('Node'), + ); + $tests['NodePostSettingsTestCase'] = array( + 'name' => t('Node post information display'), + 'description' => t('Check that the post information (submitted by Username on date) text displays appropriately.'), + 'group' => t('Node'), + ); + $tests['NodeRSSContentTestCase'] = array( + 'name' => t('Node RSS Content'), + 'description' => t('Ensure that data added to nodes by other modules appears in RSS feeds.'), + 'group' => t('Node'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function node_help($path, $arg) { Index: modules/php/php.test =================================================================== RCS file: /cvs/drupal/drupal/modules/php/php.test,v retrieving revision 1.7 diff -u -r1.7 php.test --- modules/php/php.test 21 Jan 2009 16:58:42 -0000 1.7 +++ modules/php/php.test 20 Feb 2009 03:14:50 -0000 @@ -37,13 +37,6 @@ * Tests to make sure the PHP filter actually evaluates PHP code when used. */ class PHPFilterTestCase extends PHPTestCase { - function getInfo() { - return array( - 'name' => t('PHP filter functionality'), - 'description' => t('Make sure that PHP filter properly evaluates PHP code when enabled.'), - 'group' => t('PHP'), - ); - } /** * Make sure that the PHP filter evaluates PHP code when used. @@ -80,13 +73,6 @@ * Tests to make sure access to the PHP filter is properly restricted. */ class PHPAccessTestCase extends PHPTestCase { - function getInfo() { - return array( - 'name' => t('PHP filter access check'), - 'description' => t('Make sure that users who don\'t have access to the PHP filter can\'t see it.'), - 'group' => t('PHP'), - ); - } /** * Make sure that user can't use the PHP filter when not given access. Index: modules/php/php.module =================================================================== RCS file: /cvs/drupal/drupal/modules/php/php.module,v retrieving revision 1.12 diff -u -r1.12 php.module --- modules/php/php.module 21 Jan 2009 16:58:42 -0000 1.12 +++ modules/php/php.module 20 Feb 2009 03:14:50 -0000 @@ -6,6 +6,25 @@ * Additional filter for PHP input. */ +/** + * Implementation of hook_test(). + */ +function php_test() { + $tests = array(); + + $tests['PHPFilterTestCase'] = array( + 'name' => t('PHP filter functionality'), + 'description' => t('Make sure that PHP filter properly evaluates PHP code when enabled.'), + 'group' => t('PHP'), + ); + $tests['PHPAccessTestCase'] = array( + 'name' => t('PHP filter access check'), + 'description' => t('Make sure that users who don\'t have access to the PHP filter can\'t see it.'), + 'group' => t('PHP'), + ); + + return $tests; +} /** * Implementation of hook_help(). Index: modules/forum/forum.test =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.test,v retrieving revision 1.15 diff -u -r1.15 forum.test --- modules/forum/forum.test 13 Feb 2009 05:42:24 -0000 1.15 +++ modules/forum/forum.test 20 Feb 2009 03:14:47 -0000 @@ -11,14 +11,6 @@ protected $root_forum; protected $nids; - function getInfo() { - return array( - 'name' => t('Forum functionality'), - 'description' => t('Create, view, edit, delete, and change forum entries and verify its consistency in the database.'), - 'group' => t('Forum'), - ); - } - /** * Enable modules and create users with specific permissions. */ Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.486 diff -u -r1.486 forum.module --- modules/forum/forum.module 18 Feb 2009 15:19:55 -0000 1.486 +++ modules/forum/forum.module 20 Feb 2009 03:14:47 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function forum_test() { + $tests = array(); + + $tests['ForumTestCase'] = array( + 'name' => t('Forum functionality'), + 'description' => t('Create, view, edit, delete, and change forum entries and verify its consistency in the database.'), + 'group' => t('Forum'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function forum_help($path, $arg) { Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.297 diff -u -r1.297 statistics.module --- modules/statistics/statistics.module 18 Feb 2009 15:19:56 -0000 1.297 +++ modules/statistics/statistics.module 20 Feb 2009 03:14:55 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function statistics_test() { + $tests = array(); + + $tests['StatisticsBlockVisitorsTestCase'] = array( + 'name' => t('Top visitor blocking'), + 'description' => t('Tests blocking of IP addresses via the top visitors report.'), + 'group' => t('Statistics'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function statistics_help($path, $arg) { Index: modules/statistics/statistics.test =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.test,v retrieving revision 1.6 diff -u -r1.6 statistics.test --- modules/statistics/statistics.test 30 Dec 2008 16:43:18 -0000 1.6 +++ modules/statistics/statistics.test 20 Feb 2009 03:14:55 -0000 @@ -2,13 +2,6 @@ // $Id: statistics.test,v 1.6 2008/12/30 16:43:18 dries Exp $ class StatisticsBlockVisitorsTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Top visitor blocking'), - 'description' => t('Tests blocking of IP addresses via the top visitors report.'), - 'group' => t('Statistics') - ); - } function setUp() { parent::setUp('statistics'); Index: modules/system/system.test =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.test,v retrieving revision 1.39 diff -u -r1.39 system.test --- modules/system/system.test 11 Feb 2009 05:33:18 -0000 1.39 +++ modules/system/system.test 20 Feb 2009 03:14:56 -0000 @@ -58,13 +58,6 @@ * Test module enabling/disabling functionality. */ class EnableDisableTestCase extends ModuleTestCase { - function getInfo() { - return array( - 'name' => t('Enable/disable modules'), - 'description' => t('Enable/disable core module and confirm table creation/deletion.'), - 'group' => t('Module'), - ); - } /** * Enable a module, check the database for related tables, disable module, @@ -118,13 +111,6 @@ * Test module dependency functionality. */ class ModuleDependencyTestCase extends ModuleTestCase { - function getInfo() { - return array( - 'name' => t('Module dependencies'), - 'description' => t('Enable module without dependency enabled.'), - 'group' => t('Module'), - ); - } /** * Attempt to enable translation module without locale enabled. @@ -157,13 +143,6 @@ * Test required modules functionality. */ class ModuleRequiredTestCase extends ModuleTestCase { - function getInfo() { - return array( - 'name' => t('Required modules'), - 'description' => t('Attempt disabling of required modules.'), - 'group' => t('Module'), - ); - } /** * Assert that core required modules cannot be disabled. @@ -182,17 +161,6 @@ protected $blocking_user; /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('IP address blocking'), - 'description' => t('Test IP address blocking.'), - 'group' => t('System') - ); - } - - /** * Implementation of setUp(). */ function setUp() { @@ -251,16 +219,6 @@ } class CronRunTestCase extends DrupalWebTestCase { - /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('Cron run'), - 'description' => t('Test cron run.'), - 'group' => t('System') - ); - } /** * Test cron runs. @@ -322,16 +280,6 @@ } class AdminOverviewTestCase extends DrupalWebTestCase { - /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('Admin overview'), - 'description' => t('Confirm that the admin overview page appears as expected.'), - 'group' => t('System') - ); - } /** * Test the overview page by task. @@ -389,16 +337,6 @@ } class AdminMetaTagTestCase extends DrupalWebTestCase { - /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('Fingerprinting meta tag'), - 'description' => t('Confirm that the fingerprinting meta tag appears as expected.'), - 'group' => t('System') - ); - } /** * Verify that the meta tag HTML is generated correctly. @@ -418,17 +356,6 @@ protected $admin_user; /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('403 functionality'), - 'description' => t("Tests page access denied functionality, including custom 403 pages."), - 'group' => t('System') - ); - } - - /** * Implementation of setUp(). */ function setUp() { @@ -479,17 +406,6 @@ protected $admin_user; /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('404 functionality'), - 'description' => t("Tests page not found functionality, including custom 404 pages."), - 'group' => t('System') - ); - } - - /** * Implementation of setUp(). */ function setUp() { @@ -540,13 +456,6 @@ * Tests generic date and time handling capabilities of Drupal. */ class DateTimeFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Date and time'), - 'description' => t('Configure date and time settings. Test date formatting and time zone handling, including daylight saving time.'), - 'group' => t('System'), - ); - } /** * Test time zones and DST handling. @@ -585,17 +494,6 @@ protected $saved_title; /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('HTML in page titles'), - 'description' => t('Tests correct handling or conversion by drupal_set_title() and drupal_get_title().'), - 'group' => t('System') - ); - } - - /** * Implementation of setUp(). */ function setUp() { @@ -649,14 +547,6 @@ */ class FrontPageTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Front page'), - 'description' => t('Tests front page functionality and administration.'), - 'group' => t('System'), - ); - } - function setUp() { parent::setUp('system_test'); @@ -700,13 +590,6 @@ } class SystemBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block functionality'), - 'description' => t('Configure and move powered-by block.'), - 'group' => t('System'), - ); - } function setUp() { parent::setUp(); @@ -751,16 +634,6 @@ } class SystemSettingsForm extends DrupalWebTestCase { - /** - * Implementation of getInfo(). - */ - function getInfo() { - return array( - 'name' => t('System setting forms'), - 'description' => t('Tests correctness of system_settings_form() processing.'), - 'group' => t('System') - ); - } /** * Implementation of setUp(). @@ -833,13 +706,6 @@ * Tests for the theme interface functionality. */ class SystemThemeFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Theme interface functionality'), - 'description' => t('Tests the theme interface functionality by enabling and switching themes, and using an administration theme.'), - 'group' => t('System'), - ); - } function setUp() { parent::setUp(); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.667 diff -u -r1.667 system.module --- modules/system/system.module 11 Feb 2009 05:33:18 -0000 1.667 +++ modules/system/system.module 20 Feb 2009 03:14:56 -0000 @@ -57,6 +57,91 @@ define('DRUPAL_USER_TIMEZONE_SELECT', 2); /** + * Implementation of hook_test(). + */ +function system_test() { + $tests = array(); + + $tests['EnableDisableTestCase'] = array( + 'name' => t('Enable/disable modules'), + 'description' => t('Enable/disable core module and confirm table creation/deletion.'), + 'group' => t('Module'), + ); + $tests['ModuleDependencyTestCase'] = array( + 'name' => t('Module dependencies'), + 'description' => t('Enable module without dependency enabled.'), + 'group' => t('Module'), + ); + $tests['ModuleRequiredTestCase'] = array( + 'name' => t('Required modules'), + 'description' => t('Attempt disabling of required modules.'), + 'group' => t('Module'), + ); + $tests['IPAddressBlockingTestCase'] = array( + 'name' => t('IP address blocking'), + 'description' => t('Test IP address blocking.'), + 'group' => t('System'), + ); + $tests['CronRunTestCase'] = array( + 'name' => t('Cron run'), + 'description' => t('Test cron run.'), + 'group' => t('System'), + ); + $tests['AdminOverviewTestCase'] = array( + 'name' => t('Admin overview'), + 'description' => t('Confirm that the admin overview page appears as expected.'), + 'group' => t('System'), + ); + $tests['AdminMetaTagTestCase'] = array( + 'name' => t('Fingerprinting meta tag'), + 'description' => t('Confirm that the fingerprinting meta tag appears as expected.'), + 'group' => t('System'), + ); + $tests['AccessDeniedTestCase'] = array( + 'name' => t('403 functionality'), + 'description' => t('Tests page access denied functionality, including custom 403 pages.'), + 'group' => t('System'), + ); + $tests['PageNotFoundTestCase'] = array( + 'name' => t('404 functionality'), + 'description' => t('Tests page not found functionality, including custom 404 pages.'), + 'group' => t('System'), + ); + $tests['DateTimeFunctionalTest'] = array( + 'name' => t('Date and time'), + 'description' => t('Configure date and time settings. Test date formatting and time zone handling, including daylight saving time.'), + 'group' => t('System'), + ); + $tests['PageTitleFiltering'] = array( + 'name' => t('HTML in page titles'), + 'description' => t('Tests correct handling or conversion by drupal_set_title() and drupal_get_title().'), + 'group' => t('System'), + ); + $tests['FrontPageTestCase'] = array( + 'name' => t('Front page'), + 'description' => t('Tests front page functionality and administration.'), + 'group' => t('System'), + ); + $tests['SystemBlockTestCase'] = array( + 'name' => t('Block functionality'), + 'description' => t('Configure and move powered-by block.'), + 'group' => t('System'), + ); + $tests['SystemSettingsForm'] = array( + 'name' => t('System setting forms'), + 'description' => t('Tests correctness of system_settings_form() processing.'), + 'group' => t('System'), + ); + $tests['SystemThemeFunctionalTest'] = array( + 'name' => t('Theme interface functionality'), + 'description' => t('Tests the theme interface functionality by enabling and switching themes, and using an administration theme.'), + 'group' => t('System'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function system_help($path, $arg) { Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.461 diff -u -r1.461 taxonomy.module --- modules/taxonomy/taxonomy.module 11 Feb 2009 03:53:36 -0000 1.461 +++ modules/taxonomy/taxonomy.module 20 Feb 2009 03:14:56 -0000 @@ -7,6 +7,46 @@ */ /** + * Implementation of hook_test(). + */ +function taxonomy_test() { + $tests = array(); + + $tests['TaxonomyVocabularyFunctionalTest'] = array( + 'name' => t('Taxonomy vocabulary interface'), + 'description' => t('Test the taxonomy vocabulary interface.'), + 'group' => t('Taxonomy'), + ); + $tests['TaxonomyVocabularyUnitTest'] = array( + 'name' => t('Taxonomy vocabularies'), + 'description' => t('Test loading, saving and deleting vocabularies.'), + 'group' => t('Taxonomy'), + ); + $tests['TaxonomyTermUnitTest'] = array( + 'name' => t('Taxonomy term unit tests'), + 'description' => t('Unit tests for taxonomy term functions.'), + 'group' => t('Taxonomy'), + ); + $tests['TaxonomyTermTestCase'] = array( + 'name' => t('Taxonomy term functions and forms.'), + 'description' => t('Test load, save and delete for taxonomy terms.'), + 'group' => t('Taxonomy'), + ); + $tests['TaxonomyLoadMultipleUnitTest'] = array( + 'name' => t('Taxonomy term multiple loading'), + 'description' => t('Test the loading of multiple taxonomy terms at once'), + 'group' => t('Taxonomy'), + ); + $tests['TaxonomyHooksTestCase'] = array( + 'name' => t('Taxonomy term hooks'), + 'description' => t('Hooks for taxonomy term load/save/delete.'), + 'group' => t('Taxonomy'), + ); + + return $tests; +} + +/** * Implementation of hook_perm(). */ function taxonomy_perm() { Index: modules/taxonomy/taxonomy.test =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v retrieving revision 1.25 diff -u -r1.25 taxonomy.test --- modules/taxonomy/taxonomy.test 13 Feb 2009 05:42:24 -0000 1.25 +++ modules/taxonomy/taxonomy.test 20 Feb 2009 03:14:56 -0000 @@ -43,14 +43,6 @@ */ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { - function getInfo() { - return array( - 'name' => t('Taxonomy vocabulary interface'), - 'description' => t('Test the taxonomy vocabulary interface.'), - 'group' => t('Taxonomy'), - ); - } - function setUp() { parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer taxonomy')); @@ -173,14 +165,6 @@ */ class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase { -function getInfo() { - return array( - 'name' => t('Taxonomy vocabularies'), - 'description' => t('Test loading, saving and deleting vocabularies.'), - 'group' => t('Taxonomy'), - ); - } - function setUp() { parent::setUp('taxonomy'); $admin_user = $this->drupalCreateUser(array('create article content', 'administer taxonomy')); @@ -240,14 +224,6 @@ */ class TaxonomyTermUnitTest extends TaxonomyWebTestCase { - function getInfo() { - return array( - 'name' => t('Taxonomy term unit tests'), - 'description' => t('Unit tests for taxonomy term functions.'), - 'group' => t('Taxonomy'), - ); - } - /** * Tests for taxonomy_term_count_nodes(). * @@ -315,14 +291,6 @@ */ class TaxonomyTermTestCase extends TaxonomyWebTestCase { - function getInfo() { - return array( - 'name' => t('Taxonomy term functions and forms.'), - 'description' => t('Test load, save and delete for taxonomy terms.'), - 'group' => t('Taxonomy') - ); - } - function setUp() { parent::setUp('taxonomy'); $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access')); @@ -521,14 +489,6 @@ */ class TaxonomyLoadMultipleUnitTest extends TaxonomyWebTestCase { - function getInfo() { - return array( - 'name' => t('Taxonomy term multiple loading'), - 'description' => t('Test the loading of multiple taxonomy terms at once'), - 'group' => t('Taxonomy'), - ); - } - function setUp() { parent::setUp(); $this->taxonomy_admin = $this->drupalCreateUser(array('administer taxonomy')); @@ -587,13 +547,6 @@ * Tests for taxonomy hook invocation. */ class TaxonomyHooksTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Taxonomy term hooks'), - 'description' => t('Hooks for taxonomy term load/save/delete.'), - 'group' => t('Taxonomy') - ); - } function setUp() { parent::setUp('taxonomy', 'taxonomy_test'); Index: modules/trigger/trigger.test =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.test,v retrieving revision 1.5 diff -u -r1.5 trigger.test --- modules/trigger/trigger.test 5 Dec 2008 22:18:46 -0000 1.5 +++ modules/trigger/trigger.test 20 Feb 2009 03:14:57 -0000 @@ -5,14 +5,6 @@ var $_cleanup_roles = array(); var $_cleanup_users = array(); - function getInfo() { - return array( - 'name' => t('Trigger content (node) actions'), - 'description' => t('Perform various tests with content actions.') , - 'group' => t('Trigger'), - ); - } - function setUp() { parent::setUp('trigger'); } Index: modules/trigger/trigger.module =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v retrieving revision 1.28 diff -u -r1.28 trigger.module --- modules/trigger/trigger.module 22 Jan 2009 12:46:07 -0000 1.28 +++ modules/trigger/trigger.module 20 Feb 2009 03:14:57 -0000 @@ -8,6 +8,21 @@ */ /** + * Implementation of hook_test(). + */ +function trigger_test() { + $tests = array(); + + $tests['TriggerContentTestCase'] = array( + 'name' => t('Trigger content (node) actions'), + 'description' => t('Perform various tests with content actions.'), + 'group' => t('Trigger'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function trigger_help($path, $arg) { Index: modules/dblog/dblog.test =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v retrieving revision 1.14 diff -u -r1.14 dblog.test --- modules/dblog/dblog.test 8 Jan 2009 08:42:12 -0000 1.14 +++ modules/dblog/dblog.test 20 Feb 2009 03:14:46 -0000 @@ -5,14 +5,6 @@ protected $big_user; protected $any_user; - function getInfo() { - return array( - 'name' => t('DBLog functionality'), - 'description' => t('Generate events and verify dblog entries; verify user access to log reports based on persmissions.'), - 'group' => t('DBLog'), - ); - } - /** * Enable modules and create users with specific permissions. */ Index: modules/dblog/dblog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v retrieving revision 1.35 diff -u -r1.35 dblog.module --- modules/dblog/dblog.module 25 Jan 2009 12:19:31 -0000 1.35 +++ modules/dblog/dblog.module 20 Feb 2009 03:14:45 -0000 @@ -13,6 +13,21 @@ */ /** + * Implementation of hook_test(). + */ +function dblog_test() { + $tests = array(); + + $tests['DBLogTestCase'] = array( + 'name' => t('DBLog functionality'), + 'description' => t('Generate events and verify dblog entries; verify user access to log reports based on persmissions.'), + 'group' => t('DBLog'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function dblog_help($path, $arg) { Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.36 diff -u -r1.36 simpletest.module --- modules/simpletest/simpletest.module 13 Feb 2009 00:39:01 -0000 1.36 +++ modules/simpletest/simpletest.module 20 Feb 2009 03:14:51 -0000 @@ -2,6 +2,11 @@ // $Id: simpletest.module,v 1.36 2009/02/13 00:39:01 webchick Exp $ /** + * @file + * Provides testing framework module base. + */ + +/** * Implementation of hook_help(). */ function simpletest_help($path, $arg) { @@ -89,7 +94,7 @@ $header = array(t('Message'), t('Group'), t('Filename'), t('Line'), t('Function'), array('colspan' => 2, 'data' => t('Status'))); while ($result = db_fetch_object($results)) { $class = $result->test_class; - $info = $uncategorized_tests[$class]->getInfo(); + $info = $uncategorized_tests[$class]; $group = $info['group']; $selected_tests[$group][$class] = TRUE; if (!isset($group_summary[$group])) { @@ -133,7 +138,7 @@ foreach ($form['results'] as $group => &$elements) { $group_ok = TRUE; foreach ($elements as $class => &$element) { - $info = $uncategorized_tests[$class]->getInfo(); + $info = $uncategorized_tests[$class]; $ok = $element['summary']['#fail'] + $element['summary']['#exception'] == 0; $element += array( '#type' => 'fieldset', @@ -169,9 +174,7 @@ $form['tests']['table'][$group_name] = array( '#collapsed' => TRUE, ); - foreach ($test_group as $test) { - $test_info = $test->getInfo(); - $test_class = get_class($test); + foreach ($test_group as $test_class => $test_info) { $is_selected = isset($selected_tests[$group_name][$test_class]); $form['tests']['table'][$group_name][$test_class] = array( '#type' => 'checkbox', @@ -324,21 +327,26 @@ * Run selected tests. */ function simpletest_test_form_submit($form, &$form_state) { - // Ensure that all classes are loaded before we create instances to get test information and run. - simpletest_get_all_tests(); - // Get list of tests. - $tests_list = array(); - foreach ($form_state['values'] as $class_name => $value) { - if (class_exists($class_name) && $value === 1) { - $tests_list[] = $class_name; + $test_classes = array(); + foreach ($form_state['values'] as $test_class => $value) { + if ($value === 1) { + // Load test file and ensure that test class exists. + simpletest_load_test($test_class); + if (class_exists($test_class)) { + $test_classes[] = $test_class; + } + else { + drupal_set_message(t('No such test class @class.', array('@class' => $test_class)), 'error'); + } } } - if (count($tests_list) > 0 ) { - simpletest_run_tests($tests_list, 'drupal'); + + if ($test_classes) { + simpletest_run_tests($test_classes, 'drupal'); } else { - drupal_set_message(t('No test(s) selected.'), 'error'); + drupal_set_message(t('No test(s) to run.'), 'error'); } } @@ -353,13 +361,13 @@ */ function simpletest_run_tests($test_list, $reporter = 'drupal') { cache_clear_all(); + $tests = simpletest_get_all_tests(); $test_id = db_insert('simpletest_test_id')->useDefaults(array('test_id'))->execute(); // Get the info for the first test being run. $first_test = array_shift($test_list); - $first_instance = new $first_test(); + $info = $tests[$first_test]; array_unshift($test_list, $first_test); - $info = $first_instance->getInfo(); $batch = array( 'title' => t('Running SimpleTests'), @@ -386,9 +394,6 @@ * Batch operation callback. */ function _simpletest_batch_operation($test_list_init, $test_id, &$context) { - // Ensure that all classes are loaded before we unserialize some instances. - simpletest_get_all_tests(); - // Get working values. if (!isset($context['sandbox']['max'])) { // First iteration: initialize working values. @@ -405,10 +410,15 @@ // Perform the next test. $test_class = array_shift($test_list); + + // Get test info and load test file. + $tests = simpletest_get_all_tests(); + $info = $tests[$test_class]; + simpletest_load_test($test_class); + $test = new $test_class($test_id); $test->run(); $size = count($test_list); - $info = $test->getInfo(); // Gather results and compose the report. $test_results[$test_class] = $test->results; @@ -450,46 +460,30 @@ * Get a list of all of the tests. * * @return - * An array of tests, with the class name as the keys and the instantiated - * versions of the classes as the values. + * An array of tests, with the test class name as the keys and the test + * information as the value. + * @see hook_test() */ function simpletest_get_all_tests() { - static $formatted_classes; - if (!isset($formatted_classes)) { - require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php'; - $files = array(); - foreach (array_keys(module_rebuild_cache()) as $module) { - $module_path = drupal_get_path('module', $module); - $test = $module_path . "/$module.test"; - if (file_exists($test)) { - $files[] = $test; - } + static $tests; - $tests_directory = $module_path . '/tests'; - if (is_dir($tests_directory)) { - foreach (file_scan_directory($tests_directory, '/\.test$/') as $file) { - $files[] = $file->filename; + if (!isset($tests)) { + // Manually call each module so that we can know which module a given test + // came from. + $tests = array(); + foreach (array_keys(module_rebuild_cache()) as $module) { + drupal_load('module', $module); + $test_classes = module_invoke($module, 'test'); + if ($test_classes) { + foreach (array_keys($test_classes) as $test_class) { + $test_classes[$test_class]['module'] = $module; } + $tests = array_merge($tests, $test_classes); } } - - $existing_classes = get_declared_classes(); - foreach ($files as $file) { - include_once DRUPAL_ROOT . '/' . $file; - } - $classes = array_values(array_diff(get_declared_classes(), $existing_classes)); - $formatted_classes = array(); - foreach ($classes as $key => $class) { - if (method_exists($class, 'getInfo')) { - $formatted_classes[$class] = new $class; - } - } - } - if (count($formatted_classes) == 0) { - drupal_set_message('No test cases found.', 'error'); - return FALSE; } - return $formatted_classes; + + return $tests; } /** @@ -501,15 +495,29 @@ */ function simpletest_categorize_tests($tests) { $groups = array(); - foreach ($tests as $test => $instance) { - $info = $instance->getInfo(); - $groups[$info['group']][$test] = $instance; + foreach ($tests as $test_case => $info) { + $groups[$info['group']][$test_case] = $info; } uksort($groups, 'strnatcasecmp'); return $groups; } /** + * Load test file of specified test class. Also includes the DrupalWebTestCase. + * + * @param $test_class + * Test class to load file for. + */ +function simpletest_load_test($test_class) { + module_load_include('php', 'simpletest', 'drupal_web_test_case'); + $tests = simpletest_get_all_tests(); + + $info = $tests[$test_class]; + $filename = (isset($info['file']) ? 'tests/' . $info['file'] : $info['module']); + require_once drupal_get_path('module', $info['module']) . '/' . $filename . '.test'; +} + +/** * Remove all temporary database tables and directories. */ function simpletest_clean_environment() { Index: modules/simpletest/simpletest.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.test,v retrieving revision 1.16 diff -u -r1.16 simpletest.test --- modules/simpletest/simpletest.test 22 Jan 2009 12:46:06 -0000 1.16 +++ modules/simpletest/simpletest.test 20 Feb 2009 03:14:51 -0000 @@ -13,17 +13,6 @@ */ protected $test_ids = array(); - function getInfo() { - return array( - 'name' => t('SimpleTest functionality'), - 'description' => t('Test SimpleTest\'s web interface: check that the intended tests were - run and ensure that test reports display the intended results. Also - test SimpleTest\'s internal browser and API\'s both explicitly and - implicitly.'), - 'group' => t('SimpleTest') - ); - } - function setUp() { if (!$this->inCURL()) { parent::setUp('simpletest'); @@ -231,7 +220,8 @@ */ function getResultFieldSet() { $fieldsets = $this->xpath('//fieldset'); - $info = $this->getInfo(); + $tests = simpletest_get_all_tests(); + $info = $tests[get_class($this)]; foreach ($fieldsets as $fieldset) { if ($fieldset->legend == $info['group']) { return $fieldset; Index: modules/simpletest/simpletest.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.info,v retrieving revision 1.4 diff -u -r1.4 simpletest.info --- modules/simpletest/simpletest.info 11 Oct 2008 02:33:01 -0000 1.4 +++ modules/simpletest/simpletest.info 20 Feb 2009 03:14:51 -0000 @@ -5,4 +5,5 @@ version = VERSION core = 7.x files[] = simpletest.module +files[] = simpletest.test.inc files[] = simpletest.install Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.38 diff -u -r1.38 translation.module --- modules/translation/translation.module 22 Jan 2009 03:11:54 -0000 1.38 +++ modules/translation/translation.module 20 Feb 2009 03:14:57 -0000 @@ -26,6 +26,21 @@ define('TRANSLATION_ENABLED', 2); /** + * Implementation of hook_test(). + */ +function translation_test() { + $tests = array(); + + $tests['TranslationTestCase'] = array( + 'name' => t('Translation functionality'), + 'description' => t('Create a page with translation, modify the page outdating translation, and update translation.'), + 'group' => t('Translation'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function translation_help($path, $arg) { Index: modules/translation/translation.test =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.test,v retrieving revision 1.7 diff -u -r1.7 translation.test --- modules/translation/translation.test 30 Dec 2008 16:43:19 -0000 1.7 +++ modules/translation/translation.test 20 Feb 2009 03:14:57 -0000 @@ -4,14 +4,6 @@ class TranslationTestCase extends DrupalWebTestCase { protected $book; - function getInfo() { - return array( - 'name' => t('Translation functionality'), - 'description' => t('Create a page with translation, modify the page outdating translation, and update translation.'), - 'group' => t('Translation') - ); - } - function setUp() { parent::setUp('locale', 'translation'); } Index: modules/blogapi/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v retrieving revision 1.143 diff -u -r1.143 blogapi.module --- modules/blogapi/blogapi.module 18 Feb 2009 15:19:55 -0000 1.143 +++ modules/blogapi/blogapi.module 20 Feb 2009 03:14:44 -0000 @@ -7,6 +7,21 @@ */ /** + * Implementation of hook_test(). + */ +function blogapi_test() { + $tests = array(); + + $tests['BlogAPITestCase'] = array( + 'name' => t('Blog API functionality'), + 'description' => t('Create, edit, and delete post; upload file; and set/get categories.'), + 'group' => t('Blog API'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function blogapi_help($path, $arg) { Index: modules/blogapi/blogapi.test =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.test,v retrieving revision 1.8 diff -u -r1.8 blogapi.test --- modules/blogapi/blogapi.test 30 Dec 2008 16:43:15 -0000 1.8 +++ modules/blogapi/blogapi.test 20 Feb 2009 03:14:44 -0000 @@ -2,13 +2,6 @@ // $Id: blogapi.test,v 1.8 2008/12/30 16:43:15 dries Exp $ class BlogAPITestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Blog API functionality'), - 'description' => t('Create, edit, and delete post; upload file; and set/get categories.'), - 'group' => t('Blog API'), - ); - } function setUp() { parent::setUp('blog', 'blogapi', 'taxonomy'); Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.240 diff -u -r1.240 filter.module --- modules/filter/filter.module 21 Jan 2009 16:58:42 -0000 1.240 +++ modules/filter/filter.module 20 Feb 2009 03:14:47 -0000 @@ -15,6 +15,26 @@ define('FILTER_FORMAT_DEFAULT', 0); /** + * Implementation of hook_test(). + */ +function filter_test() { + $tests = array(); + + $tests['FilterAdminTestCase'] = array( + 'name' => t('Filter administration functionality'), + 'description' => t('Thoroughly test the administrative interface of the filter module.'), + 'group' => t('Filter'), + ); + $tests['FilterTestCase'] = array( + 'name' => t('Core filters'), + 'description' => t('Filter each filter individually: Convert URLs into links, Convert line breaks, Correct broken HTML, Escape all HTML, Limit allowed HTML tags.'), + 'group' => t('Filter'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function filter_help($path, $arg) { Index: modules/filter/filter.test =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v retrieving revision 1.14 diff -u -r1.14 filter.test --- modules/filter/filter.test 26 Jan 2009 14:08:43 -0000 1.14 +++ modules/filter/filter.test 20 Feb 2009 03:14:47 -0000 @@ -2,13 +2,6 @@ // $Id: filter.test,v 1.14 2009/01/26 14:08:43 dries Exp $ class FilterAdminTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Filter administration functionality'), - 'description' => t('Thoroughly test the administrative interface of the filter module.'), - 'group' => t('Filter'), - ); - } /** * Test filter administration functionality. @@ -181,14 +174,6 @@ class FilterTestCase extends DrupalWebTestCase { protected $format; - function getInfo() { - return array( - 'name' => t('Core filters'), - 'description' => t('Filter each filter individually: Convert URLs into links, Convert line breaks, Correct broken HTML, Escape all HTML, Limit allowed HTML tags.'), - 'group' => t('Filter'), - ); - } - function setUp() { parent::setUp(); Index: modules/field/modules/text/text.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.test,v retrieving revision 1.1 diff -u -r1.1 text.test --- modules/field/modules/text/text.test 3 Feb 2009 17:30:12 -0000 1.1 +++ modules/field/modules/text/text.test 20 Feb 2009 03:14:46 -0000 @@ -4,14 +4,6 @@ class TextFieldTestCase extends DrupalWebTestCase { protected $instance; - function getInfo() { - return array( - 'name' => t('Text Field'), - 'description' => t("Test the creation of text fields."), - 'group' => t('Field') - ); - } - function setUp() { parent::setUp('field', 'text', 'field_test'); } Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.237 diff -u -r1.237 locale.module --- modules/locale/locale.module 5 Feb 2009 00:32:46 -0000 1.237 +++ modules/locale/locale.module 20 Feb 2009 03:14:48 -0000 @@ -16,6 +16,41 @@ // Hook implementations /** + * Implementation of hook_test(). + */ +function locale_test() { + $tests = array(); + + $tests['LocaleTranslationFunctionalTest'] = array( + 'name' => t('String translate and validate'), + 'description' => t('Adds a new locale and translates its name. Checks the validation of translation strings.'), + 'group' => t('Locale'), + ); + $tests['LocaleImportFunctionalTest'] = array( + 'name' => t('Translation import'), + 'description' => t('Tests the importation of locale files.'), + 'group' => t('Locale'), + ); + $tests['LocaleUninstallFunctionalTest'] = array( + 'name' => t('Locale uninstall (EN)'), + 'description' => t('Tests the uninstall process using the built-in UI language.'), + 'group' => t('Locale'), + ); + $tests['LocaleUninstallFrenchFunctionalTest'] = array( + 'name' => t('Locale uninstall (FR)'), + 'description' => t('Tests the uninstall process using French as UI language.'), + 'group' => t('Locale'), + ); + $tests['LanguageSwitchingFunctionalTest'] = array( + 'name' => t('Language switching'), + 'description' => t('Tests for the language switching feature.'), + 'group' => t('Locale'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function locale_help($path, $arg) { Index: modules/locale/locale.test =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v retrieving revision 1.17 diff -u -r1.17 locale.test --- modules/locale/locale.test 13 Feb 2009 00:45:18 -0000 1.17 +++ modules/locale/locale.test 20 Feb 2009 03:14:48 -0000 @@ -16,13 +16,6 @@ * Functional test for string translation and validation. */ class LocaleTranslationFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('String translate and validate'), - 'description' => t('Adds a new locale and translates its name. Checks the validation of translation strings.'), - 'group' => 'Locale', - ); - } function setUp() { parent::setUp('locale'); @@ -199,13 +192,6 @@ * Functional tests for the import of translation files. */ class LocaleImportFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Translation import'), - 'description' => t('Tests the importation of locale files.'), - 'group' => t('Locale'), - ); - } /** * A user able to create languages and import translations. @@ -330,13 +316,6 @@ * Locale uninstall with English UI functional test. */ class LocaleUninstallFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Locale uninstall (EN)'), - 'description' => t('Tests the uninstall process using the built-in UI language.'), - 'group' => t('Locale'), - ); - } /** * The default language set for the UI before uninstall. @@ -436,13 +415,6 @@ * to test with this new language. */ class LocaleUninstallFrenchFunctionalTest extends LocaleUninstallFunctionalTest { - function getInfo() { - return array( - 'name' => t('Locale uninstall (FR)'), - 'description' => t('Tests the uninstall process using French as UI language.'), - 'group' => t('Locale'), - ); - } function setUp() { parent::setUp(); @@ -456,14 +428,6 @@ */ class LanguageSwitchingFunctionalTest extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Language switching'), - 'description' => t('Tests for the language switching feature.'), - 'group' => t('Locale'), - ); - } - function setUp() { parent::setUp('locale'); Index: modules/field/field.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.test,v retrieving revision 1.5 diff -u -r1.5 field.test --- modules/field/field.test 10 Feb 2009 03:16:14 -0000 1.5 +++ modules/field/field.test 20 Feb 2009 03:14:46 -0000 @@ -4,13 +4,6 @@ // TODO : use drupalCreateField() / drupalCreateFieldInstance() all over ? class FieldAttachTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Field attach tests'), - 'description' => t("Test Field Attach API functions."), - 'group' => t('Field') - ); - } function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); @@ -605,14 +598,6 @@ class FieldInfoTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Field info tests'), - 'description' => t("Get information about existing fields, instances and bundles."), - 'group' => t('Field') - ); - } - function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); } @@ -711,13 +696,6 @@ } class FieldFormTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Field form tests'), - 'description' => t("Test Field form handling."), - 'group' => t('Field') - ); - } function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); @@ -918,13 +896,6 @@ } class FieldTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Field tests'), - 'description' => t("Create / read /update a field."), - 'group' => t('Field') - ); - } function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); @@ -1042,14 +1013,6 @@ class FieldInstanceTestCase extends DrupalWebTestCase { protected $field; - function getInfo() { - return array( - 'name' => t('Field instance tests'), - 'description' => t("Create field entities by attaching fields to entities."), - 'group' => t('Field') - ); - } - function setUp() { parent::setUp('field_sql_storage', 'field', 'field_test'); Index: modules/field/field.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.module,v retrieving revision 1.4 diff -u -r1.4 field.module --- modules/field/field.module 10 Feb 2009 03:16:14 -0000 1.4 +++ modules/field/field.module 20 Feb 2009 03:14:46 -0000 @@ -79,6 +79,41 @@ define('FIELD_LOAD_REVISION', 'FIELD_LOAD_REVISION'); /** + * Implementation of hook_test(). + */ +function field_test() { + $tests = array(); + + $tests['FieldAttachTestCase'] = array( + 'name' => t('Field attach tests'), + 'description' => t('Test Field Attach API functions.'), + 'group' => t('Field'), + ); + $tests['FieldInfoTestCase'] = array( + 'name' => t('Field info tests'), + 'description' => t('Get information about existing fields, instances and bundles.'), + 'group' => t('Field'), + ); + $tests['FieldFormTestCase'] = array( + 'name' => t('Field form tests'), + 'description' => t('Test Field form handling.'), + 'group' => t('Field'), + ); + $tests['FieldTestCase'] = array( + 'name' => t('Field tests'), + 'description' => t('Create / read /update a field.'), + 'group' => t('Field'), + ); + $tests['FieldInstanceTestCase'] = array( + 'name' => t('Field instance tests'), + 'description' => t('Create field entities by attaching fields to entities.'), + 'group' => t('Field'), + ); + + return $tests; +} + +/** * Implementation of hook_flush_caches. */ function field_flush_caches() { Index: scripts/run-tests.sh =================================================================== RCS file: /cvs/drupal/drupal/scripts/run-tests.sh,v retrieving revision 1.23 diff -u -r1.23 run-tests.sh --- scripts/run-tests.sh 1 Feb 2009 16:42:26 -0000 1.23 +++ scripts/run-tests.sh 20 Feb 2009 03:14:58 -0000 @@ -52,11 +52,9 @@ // Display all available tests. echo "\nAvailable test groups & classes\n"; echo "-------------------------------\n\n"; - foreach ($groups as $group => $tests) { - echo $group . "\n"; - foreach ($tests as $class_name => $instance) { - $info = $instance->getInfo(); - echo " - " . $info['name'] . ' (' . $class_name . ')' . "\n"; + foreach ($groups as $group_name => $test_group) { + foreach ($test_group as $test_class => $test_info) { + echo " - " . $test_info['name'] . ' (' . $class_name . ')' . "\n"; } } exit; @@ -343,10 +341,12 @@ * Run a single test (assume a Drupal bootstrapped environment). */ function simpletest_script_run_one_test($test_id, $test_class) { - simpletest_get_all_tests(); + simpletest_load_test($test_class); + $tests = simpletest_get_all_tests(); + $info = $tests[$test_class]; + $test = new $test_class($test_id); $test->run(); - $info = $test->getInfo(); $status = ((isset($test->results['#fail']) && $test->results['#fail'] > 0) || (isset($test->results['#exception']) && $test->results['#exception'] > 0) ? 'fail' : 'pass'); @@ -443,7 +443,7 @@ else { echo "Tests to be run:\n"; foreach ($test_list as $class_name) { - $info = $all_tests[$class_name]->getInfo(); + $info = $all_tests[$class_name]; echo " - " . $info['name'] . ' (' . $class_name . ')' . "\n"; } echo "\n"; Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.227 diff -u -r1.227 upload.module --- modules/upload/upload.module 3 Feb 2009 18:55:32 -0000 1.227 +++ modules/upload/upload.module 20 Feb 2009 03:14:57 -0000 @@ -8,6 +8,21 @@ */ /** + * Implementation of hook_test(). + */ +function upload_test() { + $tests = array(); + + $tests['UploadTestCase'] = array( + 'name' => t('Upload functionality'), + 'description' => t('Check content uploaded to nodes.'), + 'group' => t('Upload'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function upload_help($path, $arg) { Index: modules/upload/upload.test =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v retrieving revision 1.12 diff -u -r1.12 upload.test --- modules/upload/upload.test 27 Jan 2009 00:22:27 -0000 1.12 +++ modules/upload/upload.test 20 Feb 2009 03:14:57 -0000 @@ -2,13 +2,6 @@ // $Id: upload.test,v 1.12 2009/01/27 00:22:27 dries Exp $ class UploadTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Upload functionality'), - 'description' => t('Check content uploaded to nodes.'), - 'group' => t('Upload'), - ); - } function setUp() { parent::setUp('upload'); Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.251 diff -u -r1.251 profile.module --- modules/profile/profile.module 22 Jan 2009 12:46:06 -0000 1.251 +++ modules/profile/profile.module 20 Feb 2009 03:14:50 -0000 @@ -27,6 +27,46 @@ define('PROFILE_HIDDEN', 4); /** + * Implementation of hook_test(). + */ +function profile_test() { + $tests = array(); + + $tests['ProfileTestFields'] = array( + 'name' => t('Test single fields'), + 'description' => t('Testing profile module with add/edit/delete textfield, textarea, list, checkbox, and url fields into profile page'), + 'group' => t('Profile'), + ); + $tests['ProfileTestSelect'] = array( + 'name' => t('Test select field'), + 'description' => t('Testing profile module with add/edit/delete a select field'), + 'group' => t('Profile'), + ); + $tests['ProfileTestDate'] = array( + 'name' => t('Test date field'), + 'description' => t('Testing profile module with add/edit/delete a date field'), + 'group' => t('Profile'), + ); + $tests['ProfileTestWeights'] = array( + 'name' => t('Test field weights'), + 'description' => t('Testing profile modules weigting of fields'), + 'group' => t('Profile'), + ); + $tests['ProfileTestAutocomplete'] = array( + 'name' => t('Autocompletion'), + 'description' => t('Test profile fields with autocompletion.'), + 'group' => t('Profile'), + ); + $tests['ProfileBlockTestCase'] = array( + 'name' => t('Block availability'), + 'description' => t('Check if the author-information block is available.'), + 'group' => t('Profile'), + ); + + return $tests; +} + +/** * Implementation of hook_help(). */ function profile_help($path, $arg) { Index: modules/profile/profile.test =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.test,v retrieving revision 1.11 diff -u -r1.11 profile.test --- modules/profile/profile.test 8 Jan 2009 19:09:49 -0000 1.11 +++ modules/profile/profile.test 20 Feb 2009 03:14:50 -0000 @@ -114,12 +114,6 @@ } class ProfileTestFields extends ProfileTestCase { - function getInfo() { - return array( - 'name' => 'Test single fields', - 'description' => t('Testing profile module with add/edit/delete textfield, textarea, list, checkbox, and url fields into profile page') , - 'group' => t('Profile')); - } /** * Test each of the field types. List selection and date fields are tested @@ -149,12 +143,6 @@ } class ProfileTestSelect extends ProfileTestCase { - function getInfo() { - return array( - 'name' => 'Test select field', - 'description' => t('Testing profile module with add/edit/delete a select field') , - 'group' => t('Profile')); - } /** * Create a list selection field, give it a value, and delete the field. @@ -174,12 +162,6 @@ } class ProfileTestDate extends ProfileTestCase { - function getInfo() { - return array( - 'name' => 'Test date field', - 'description' => t('Testing profile module with add/edit/delete a date field') , - 'group' => t('Profile')); - } /** * Create a date field, give it a value, and delete the field. @@ -210,12 +192,6 @@ } class ProfileTestWeights extends ProfileTestCase { - function getInfo() { - return array( - 'name' => 'Test field weights', - 'description' => t('Testing profile modules weigting of fields') , - 'group' => t('Profile')); - } function testProfileFieldWeights() { $this->drupalLogin($this->admin_user); @@ -239,13 +215,6 @@ * Test profile field autocompletion and access. */ class ProfileTestAutocomplete extends ProfileTestCase { - function getInfo() { - return array( - 'name' => t('Autocompletion'), - 'description' => t('Test profile fields with autocompletion.'), - 'group' => t('Profile') - ); - } /** * Tests profile field autocompletion and access. @@ -292,13 +261,6 @@ } class ProfileBlockTestCase extends DrupalWebTestCase { - function getInfo() { - return array( - 'name' => t('Block availability'), - 'description' => t('Check if the author-information block is available.'), - 'group' => t('Profile'), - ); - } function setUp() { parent::setUp('profile'); Index: modules/simpletest/simpletest.api.php =================================================================== RCS file: modules/simpletest/simpletest.api.php diff -N modules/simpletest/simpletest.api.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/simpletest.api.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ + t('Example'), + 'description' => t('Tests example stuff.'), + 'group' => t('Example'), + ); + + // File additional_example.test found in /path/to/module/tests directory. + $tests['AdditionalExampleTestCase'] = array( + 'name' => t('Additional example'), + 'description' => t('Tests additional example stuff.'), + 'group' => t('Example'), + 'file' => 'additional_example', + ); + + return $tests; +} + +/** + * @} End of "addtogroup hooks". + */ Index: modules/simpletest/simpletest.test.inc =================================================================== RCS file: modules/simpletest/simpletest.test.inc diff -N modules/simpletest/simpletest.test.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/simpletest.test.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,493 @@ + t('SimpleTest functionality'), + 'description' => t('Test SimpleTest\'s web interface: check that the intended tests were + run and ensure that test reports display the intended results. Also + test SimpleTest\'s internal browser and API\'s both explicitly and + implicitly.'), + 'group' => t('SimpleTest'), + ); + $tests['FormsTestCase'] = array( + 'name' => t('Required field validation'), + 'description' => t('Carriage returns, tabs, and spaces are not valid content for a required field.'), + 'group' => t('Form API'), + 'file' => 'form', + ); + $tests['FormsTestTypeCase'] = array( + 'name' => t('Form type-specific tests'), + 'description' => t('Test form type functions for expected behavior.'), + 'group' => t('Form API'), + 'file' => 'form', + ); + $tests['FormsElementsTableSelectFunctionalTest'] = array( + 'name' => t('Tableselect form element type test'), + 'description' => t('Test the tableselect element for expected behavior'), + 'group' => t('Form API'), + 'file' => 'form', + ); + $tests['SessionTestCase'] = array( + 'name' => t('Session tests'), + 'description' => t('Drupal session handling tests.'), + 'group' => t('Session'), + 'file' => 'session', + ); + $tests['RegistryParseFileTestCase'] = array( + 'name' => t('Registry parse file test'), + 'description' => t('Parse a simple file and check that its resources are saved to the database.'), + 'group' => t('System'), + 'file' => 'registry', + ); + $tests['RegistryParseFilesTestCase'] = array( + 'name' => t('Registry parse files test'), + 'description' => t('Read two a simple files from disc, and check that their resources are saved to the database.'), + 'group' => t('System'), + 'file' => 'registry', + ); + $tests['ModuleUnitTest'] = array( + 'name' => t('Module API'), + 'description' => t('Test low-level module functions.'), + 'group' => t('Module'), + 'file' => 'module', + ); + $tests['UnicodeUnitTest'] = array( + 'name' => t('Unicode handling'), + 'description' => t('Tests Drupal Unicode handling.'), + 'group' => t('System'), + 'file' => 'unicode', + ); + $tests['BootstrapIPAddressTestCase'] = array( + 'name' => t('IP address and HTTP_HOST test'), + 'description' => t('Get the IP address from the current visitor from the server variables, check hostname validation.'), + 'group' => t('Bootstrap'), + 'file' => 'bootstrap', + ); + $tests['BootstrapPageCacheTestCase'] = array( + 'name' => t('Page cache test'), + 'description' => t('Enable the page cache and test it with conditional HTTP requests.'), + 'group' => t('Bootstrap'), + 'file' => 'bootstrap', + ); + $tests['BootstrapVariableTestCase'] = array( + 'name' => t('Variable test'), + 'description' => t('Make sure the variable system functions correctly.'), + 'group' => t('Bootstrap'), + 'file' => 'bootstrap', + ); + $tests['HookBootExitTestCase'] = array( + 'name' => t('Boot and exit hook invocation'), + 'description' => t('Test that hook_boot() and hook_exit() are called correctly.'), + 'group' => t('Bootstrap'), + 'file' => 'bootstrap', + ); + $tests['MenuIncTestCase'] = array( + 'name' => t('Hook menu tests'), + 'description' => t('Test menu hook functionality.'), + 'group' => t('Menu'), + 'file' => 'menu', + ); + $tests['MenuRebuildTestCase'] = array( + 'name' => t('Menu rebuild test'), + 'description' => t('Test rebuilding of menu.'), + 'group' => t('Menu'), + 'file' => 'menu', + ); + $tests['DatabaseConnectionTestCase'] = array( + 'name' => t('Connection tests'), + 'description' => t('Tests of the core database system.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseFetchTestCase'] = array( + 'name' => t('Fetch tests'), + 'description' => t('Test the Database system\'s various fetch capabilities.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseFetch2TestCase'] = array( + 'name' => t('Fetch tests, part 2'), + 'description' => t('Test the Database system\'s various fetch capabilities.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseInsertTestCase'] = array( + 'name' => t('Insert tests'), + 'description' => t('Test the Insert query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseInsertLOBTestCase'] = array( + 'name' => t('Insert tests, LOB fields'), + 'description' => t('Test the Insert query builder with LOB fields.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseInsertDefaultsTestCase'] = array( + 'name' => t('Insert tests, default fields'), + 'description' => t('Test the Insert query builder with default values.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseUpdateTestCase'] = array( + 'name' => t('Update tests'), + 'description' => t('Test the Update query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseUpdateComplexTestCase'] = array( + 'name' => t('Update tests, Complex'), + 'description' => t('Test the Update query builder, complex queries.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseUpdateLOBTestCase'] = array( + 'name' => t('Update tests, LOB'), + 'description' => t('Test the Update query builder with LOB fields.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseDeleteTestCase'] = array( + 'name' => t('Delete tests'), + 'description' => t('Test the Delete query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseMergeTestCase'] = array( + 'name' => t('Merge tests'), + 'description' => t('Test the Merge query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseSelectTestCase'] = array( + 'name' => t('Select tests'), + 'description' => t('Test the Select query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseSelectSubqueryTestCase'] = array( + 'name' => t('Select tests, subqueries'), + 'description' => t('Test the Select query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseSelectOrderedTestCase'] = array( + 'name' => t('Select tests, ordered'), + 'description' => t('Test the Select query builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseSelectComplexTestCase'] = array( + 'name' => t('Select tests, complex'), + 'description' => t('Test the Select query builder with more complex queries.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseTaggingTestCase'] = array( + 'name' => t('Query tagging tests'), + 'description' => t('Test the tagging capabilities of the Select builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseAlterTestCase'] = array( + 'name' => t('Query altering tests'), + 'description' => t('Test the hook_query_alter capabilities of the Select builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseAlter2TestCase'] = array( + 'name' => t('Query altering tests, part 2'), + 'description' => t('Test the hook_query_alter capabilities of the Select builder.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseRegressionTestCase'] = array( + 'name' => t('Regression tests'), + 'description' => t('Regression tests cases for the database layer.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseLoggingTestCase'] = array( + 'name' => t('Query logging'), + 'description' => t('Test the query logging facility.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseRangeQueryTestCase'] = array( + 'name' => t('Range query test'), + 'description' => t('Test the Range query functionality.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseTemporaryQueryTestCase'] = array( + 'name' => t('Temporary query test'), + 'description' => t('Test the temporary query functionality.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseAnsiSyntaxTestCase'] = array( + 'name' => t('ANSI SQL syntax tests'), + 'description' => t('Test ANSI SQL syntax interpretation.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseInvalidDataTestCase'] = array( + 'name' => t('SQL handling tests'), + 'description' => t('Test handling of invalid data.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseQueryTestCase'] = array( + 'name' => t('Custom query syntax tests'), + 'description' => t('Test Drupal\'s extended prepared statement syntax..'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['DatabaseTransactionTestCase'] = array( + 'name' => t('Transaction tests'), + 'description' => t('Test the transaction abstraction system.'), + 'group' => t('Database'), + 'file' => 'database_test', + ); + $tests['FileSpaceUsedTest'] = array( + 'name' => t('File space used tests'), + 'description' => t('Tests the file_space_used() function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileValidatorTest'] = array( + 'name' => t('File validator tests'), + 'description' => t('Tests the functions used to validate uploaded files.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileUnmanagedSaveDataTest'] = array( + 'name' => t('Unmanaged file save data'), + 'description' => t('Tests the unmanaged file save data function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileSaveUploadTest'] = array( + 'name' => t('File uploading'), + 'description' => t('Tests the file uploading functions.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileDirectoryTest'] = array( + 'name' => t('File paths and directories'), + 'description' => t('Tests operations dealing with directories.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileScanDirectoryTest'] = array( + 'name' => t('File scan directory'), + 'description' => t('Tests the file_scan_directory() function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileUnmanagedDeleteTest'] = array( + 'name' => t('Unmanaged file delete'), + 'description' => t('Tests the unmanaged file delete function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileUnmanagedDeleteRecursiveTest'] = array( + 'name' => t('Unmanaged recursive file delete'), + 'description' => t('Tests the unmanaged file delete recursive function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileUnmanagedMoveTest'] = array( + 'name' => t('Unmanaged file moving'), + 'description' => t('Tests the unmanaged file move function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileUnmanagedCopyTest'] = array( + 'name' => t('Unmanaged file copying'), + 'description' => t('Tests the unmanaged file copy function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileDeleteTest'] = array( + 'name' => t('File delete'), + 'description' => t('Tests the file delete function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileMoveTest'] = array( + 'name' => t('File moving'), + 'description' => t('Tests the file move function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileCopyTest'] = array( + 'name' => t('File copying'), + 'description' => t('Tests the file copy function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileLoadTest'] = array( + 'name' => t('File loading'), + 'description' => t('Tests the file_load() function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileSaveTest'] = array( + 'name' => t('File saving'), + 'description' => t('Tests the file_save() function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileValidateTest'] = array( + 'name' => t('File validate'), + 'description' => t('Tests the file_validate() function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileSaveDataTest'] = array( + 'name' => t('File save data'), + 'description' => t('Tests the file save data function.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileDownloadTest'] = array( + 'name' => t('File download'), + 'description' => t('Tests for file download/transfer functions.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['FileNameMungingTest'] = array( + 'name' => t('File naming'), + 'description' => t('Test filename munging and unmunging.'), + 'group' => t('File'), + 'file' => 'file', + ); + $tests['CommonLUnitTest'] = array( + 'name' => t('Tests for the l() function'), + 'description' => t('Confirm that url() works correctly with various input.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['CommonSizeTestCase'] = array( + 'name' => t('Size parsing test'), + 'description' => t('Parse a predefined amount of bytes and compare the output with the expected value.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalTagsHandlingTestCase'] = array( + 'name' => t('Drupal tags handling'), + 'description' => t('Performs tests on Drupal\'s handling of tags, both explosion and implosion tactics used.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['CascadingStylesheetsTestCase'] = array( + 'name' => t('Cascading stylesheets'), + 'description' => t('Tests adding various cascading stylesheets to the page.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalHTTPRequestTestCase'] = array( + 'name' => t('Drupal HTTP request'), + 'description' => t('Performs tests on Drupal\'s HTTP request mechanism.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalSetContentTestCase'] = array( + 'name' => t('Drupal set/get content'), + 'description' => t('Performs tests on setting and retrieiving content from theme regions.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['JavaScriptTestCase'] = array( + 'name' => t('JavaScript'), + 'description' => t('Tests the JavaScript system.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalRenderUnitTestCase'] = array( + 'name' => t('Drupal render'), + 'description' => t('Performs unit tests on drupal_render().'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalErrorHandlerUnitTest'] = array( + 'name' => t('Drupal error handlers'), + 'description' => t('Performs tests on the Drupal error and exception handler.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['ValidUrlTestCase'] = array( + 'name' => t('Valid Url'), + 'description' => t('Performs tests on Drupal\'s valid url function.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalDataApiTest'] = array( + 'name' => t('Data API functions'), + 'description' => t('Tests the performance of CRUD APIs.'), + 'group' => t('System'), + 'file' => 'common', + ); + $tests['DrupalErrorCollectionUnitTest'] = array( + 'name' => t('SimpleTest error collecter'), + 'description' => t('Performs tests on the Simpletest error and exception collecter.'), + 'group' => t('SimpleTest'), + 'file' => 'common', + ); + $tests['XMLRPCValidator1IncTestCase'] = array( + 'name' => t('XML-RPC validator'), + 'description' => t('See the xmlrpc validator1 specification.'), + 'group' => t('XML-RPC'), + 'file' => 'xmlrpc', + ); + $tests['XMLRPCMessagesTestCase'] = array( + 'name' => t('XML-RPC message'), + 'description' => t('Test large messages.'), + 'group' => t('XML-RPC'), + 'file' => 'xmlrpc', + ); + $tests['SchemaTestCase'] = array( + 'name' => t('Schema API'), + 'description' => t('Tests table creation and modification via the schema API.'), + 'group' => t('Database'), + 'file' => 'schema', + ); + $tests['ActionsConfigurationTestCase'] = array( + 'name' => t('Actions configuration'), + 'description' => t('Tests complex actions configuration by adding, editing, and deleting a complex action.'), + 'group' => t('System'), + 'file' => 'actions', + ); + $tests['CacheSavingCase'] = array( + 'name' => t('Cache saving test'), + 'description' => t('Check our variables are saved and restored the right way.'), + 'group' => t('Cache'), + 'file' => 'cache', + ); + $tests['CacheClearCase'] = array( + 'name' => t('Cache clear test'), + 'description' => t('Check our clearing is done the proper way.'), + 'group' => t('Cache'), + 'file' => 'cache', + ); + $tests['GraphUnitTest'] = array( + 'name' => t('Graph'), + 'description' => t('Graph handling unit tests.'), + 'group' => t('System'), + 'file' => 'graph', + ); + + return $tests; +}