diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php index 322c7f41d6a3909716bb3ba3dab46c4d76a069aa..74e0b44f8fa7831550c9a9de97f3e35912719a87 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php @@ -13,8 +13,16 @@ * Defines a base class for testing aggregator.module. */ abstract class AggregatorTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'block', 'aggregator', 'aggregator_test'); + function setUp() { - parent::setUp(array('node', 'block', 'aggregator', 'aggregator_test')); + parent::setUp(); // Create an Article node type. if ($this->profile != 'standard') { diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php index 0397802259ce9c63321c587f841e68734db3b15a..7ba81c1a9de228b536c876ee1bec9f49a2719910 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php @@ -13,6 +13,14 @@ * Test the block system with admin themes. */ class BlockAdminThemeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Admin theme block admin accessibility', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('block')); - } - /** * Check for the accessibility of the admin theme on the block admin page. */ diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php index e9a16036c1d996f5f6148702576ed819ae905619..90327f9b043463b79eb8f85d5ab29082c2b271c2 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php @@ -13,6 +13,14 @@ * Test block caching. */ class BlockCacheTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'block_test'); + protected $admin_user; protected $normal_user; protected $normal_user_alt; @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'block_test')); + parent::setUp(); // Create an admin user, log in and enable test blocks. $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php index 0c3186c08dc78104648ebd798042d96a9ab7430c..13a78af11c6422e181ada45f256a4d4b059bc213 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php @@ -13,6 +13,14 @@ * Tests that hidden regions do not inherit blocks when a theme is enabled. */ class BlockHiddenRegionTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'block_test', 'search'); + public static function getInfo() { return array( 'name' => 'Blocks not in hidden region', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'block_test', 'search')); + parent::setUp(); // Enable Search block in default theme. db_merge('block') diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php index c0891acc8a089f6b4a9489d4bc4936f4bcd2e0e4..fd2870293bb3500bb6f9c7dc77e9e0a7d8e276ca 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php @@ -14,6 +14,13 @@ */ class BlockHtmlIdTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'block_test'); + public static function getInfo() { return array( 'name' => 'Block HTML id', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'block_test')); + parent::setUp(); // Create an admin user, log in and enable test blocks. $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php index 8882b642189ab07035c79d71548527d6b042a8b0..f372c13662fd76dc6af909a1afaa53918ee8355a 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php @@ -13,6 +13,14 @@ * Tests that a block assigned to an invalid region triggers the warning. */ class BlockInvalidRegionTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'block_test'); + public static function getInfo() { return array( 'name' => 'Blocks in invalid regions', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'block_test')); + parent::setUp(); // Create an admin user. $admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages')); $this->drupalLogin($admin_user); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php index 04aef2d36e6f99c7cc0bbf4fe836bd13bc090200..49d6a76f801da196f86907aaadd509ea5d78753c 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php @@ -13,6 +13,14 @@ * Functional tests for the language list configuration forms. */ class BlockLanguageTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'block'); + public static function getInfo() { return array( 'name' => 'Language block visibility', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('language', 'block'); - } - /** * Tests the visibility settings for the blocks based on language. */ diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 696a2813d4d265c2bfda3c6ef63e0feb93f5182d..f98da2bfb43bd61f14a150dbe8e938b52d7d29c8 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class BlockTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + protected $regions; protected $admin_user; @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create Full HTML text format. $full_html_format = array( diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockUserAccountSettingsTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockUserAccountSettingsTest.php index 4878b51c4e60d9868f214e40e5c630853c69809b..ef482ee834e6b132baeec394fbed7df7b301058a 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockUserAccountSettingsTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockUserAccountSettingsTest.php @@ -13,6 +13,14 @@ * Tests personalized block settings for user accounts. */ class BlockUserAccountSettingsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'field_ui'); + public static function getInfo() { return array( 'name' => 'Personalized block settings', @@ -22,7 +30,7 @@ public static function getInfo() { } public function setUp() { - parent::setUp(array('block', 'field_ui')); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer users')); $this->drupalLogin($admin_user); } diff --git a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php index b17e6012d91964b1b18de1d5e141d91be5b41e11..bf1ba7abe7e6aec6568791f1b5e4750b7bf39500 100644 --- a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php @@ -13,6 +13,14 @@ * Test blocks correctly initialized when picking a new default theme. */ class NewDefaultThemeBlocksTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'New default theme blocks', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('block')); - } - /** * Check the enabled Bartik blocks are correctly copied over. */ diff --git a/core/modules/block/lib/Drupal/block/Tests/NonDefaultBlockAdminTest.php b/core/modules/block/lib/Drupal/block/Tests/NonDefaultBlockAdminTest.php index 376ba0984a508459c935c5923504f02140230561..381b49a6082b41654bb003385f7999a6d12da4c1 100644 --- a/core/modules/block/lib/Drupal/block/Tests/NonDefaultBlockAdminTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/NonDefaultBlockAdminTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class NonDefaultBlockAdminTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Non default theme admin', @@ -18,10 +26,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('block')); - } - /** * Test non-default theme admin. */ diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index a5c314671c8ddc058b7d3416700909cd32e6a643..f4106ef815de39a0a029b67cd68e41920b03b49e 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -11,6 +11,14 @@ use Drupal\simpletest\WebTestBase; class BookTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('book', 'block', 'node_access_test'); + protected $book; // $book_author is a user with permission to create and edit books. protected $book_author; @@ -29,7 +37,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('book', 'block', 'node_access_test')); + parent::setUp(); // node_access_test requires a node_access_rebuild(). node_access_rebuild(); diff --git a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php index 3bc95d32abad2715186e75cfbe462f5b38ad04fe..3a4691602786ca98c23400454bbb62a065a8df76 100644 --- a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php +++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php @@ -13,6 +13,14 @@ * Tests the Color module functionality. */ class ColorTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('color'); + protected $big_user; protected $themes; protected $colorTests; @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('color'); + parent::setUp(); // Create users. $this->big_user = $this->drupalCreateUser(array('administer themes')); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php index c6d48a55d91470d1332fafea5a8da24f104646a2..74d97392536243eea0d23d05afea9c155e920477 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php @@ -17,6 +17,14 @@ * access module is in use. */ class CommentNodeAccessTest extends CommentTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public static function getInfo() { return array( 'name' => 'Comment node access', @@ -26,13 +34,12 @@ public static function getInfo() { } function setUp() { - WebTestBase::setUp('comment', 'search', 'node_access_test'); + parent::setUp(); + node_access_rebuild(); - // Create users and test node. - $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks')); + // Re-create user. $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments', 'node test view')); - $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->web_user->uid)); } /** diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php index 0975a8a7306ad56b8ccd87b116750b12840443aa..24d5b395cdc5702943bea883fd51fc1e0dec4558 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php @@ -11,6 +11,14 @@ use Drupal\simpletest\WebTestBase; abstract class CommentTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment', 'search'); + protected $profile = 'standard'; protected $admin_user; @@ -18,7 +26,8 @@ abstract class CommentTestBase extends WebTestBase { protected $node; function setUp() { - parent::setUp('comment', 'search'); + parent::setUp(); + // Create users and test node. $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks')); $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments')); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php index a6e72b454ce64941b7a6c421c851c7df18978d02..ec92fdf9a311ef2f1c3d3b9894cd746a75343387 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php @@ -15,6 +15,14 @@ * Tests importing configuration from files into active store. */ class ConfigImportTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('config_test'); + public static function getInfo() { return array( 'name' => 'Import configuration', @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('config_test')); - } - /** * Tests deletion of configuration during import. */ diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php index 0b43de46c6485906566d9b77ca1ffd843087f29e..6fe07de712b68ebe004d886a82f4d25869be3bbd 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php @@ -14,6 +14,14 @@ * Tests migration of variables into configuration objects. */ class ConfigUpgradeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('config_upgrade'); + protected $testContent = 'Olá, Sao Paulo!'; public static function getInfo() { @@ -25,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('config_upgrade'); + parent::setUp(); require_once DRUPAL_ROOT . '/core/includes/update.inc'; } diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php index 2b74501e9212c2ab7bc688745671ed2200db97cd..059923f155ef1b0c31a96f9215c8a040c4c5895f 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php @@ -14,6 +14,13 @@ */ class ContactAuthenticatedUserTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('contact'); + public static function getInfo() { return array( 'name' => 'Contact form textfields', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('contact')); - } - /** * Tests that name and email fields are not present for authenticated users. */ diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php index 84b1541c4c933a5b4bd20d4be08a108701bfd536..16d26b00846b9f5edf9006b43dbe0792a038c2b7 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php @@ -13,6 +13,14 @@ * Tests the personal contact form. */ class ContactPersonalTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('contact'); + private $admin_user; private $web_user; private $contact_user; @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('contact'); + parent::setUp(); // Create an admin user. $this->admin_user = $this->drupalCreateUser(array('administer contact forms', 'administer users')); diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php index 318379fbc066064b0fc719f26c108920255df140..7eae7094a9a06c3513474f8b4db24f8e40f611cd 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php @@ -13,6 +13,14 @@ * Tests the site-wide contact form. */ class ContactSitewideTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('contact'); + public static function getInfo() { return array( 'name' => 'Site-wide contact form', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('contact'); - } - /** * Tests configuration options and the site-wide contact form. */ diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php index f1f0df618c9728809746b0f0bac734957778eafc..da786a2ff6515c22cb0a731addb4d4c95382d9af 100644 --- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php @@ -13,6 +13,14 @@ * Tests accessible links after inaccessible links on dynamic context. */ class ContextualDynamicContextTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('contextual', 'node'); + public static function getInfo() { return array( 'name' => 'Contextual links on node lists', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('contextual', 'node')); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); $web_user = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content')); diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php index fd1e9afb2852063afbf01e0d22d012758af921aa..94181db22623e0cee3aa39c91e3ca622c88f76ad 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php @@ -11,6 +11,14 @@ use SimpleXMLElement; class DBLogTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('dblog', 'poll'); + protected $profile = 'standard'; protected $big_user; @@ -24,12 +32,10 @@ public static function getInfo() { ); } - /** - * Enable modules and create users with specific permissions. - */ function setUp() { - parent::setUp('dblog', 'poll'); - // Create users. + parent::setUp(); + + // Create users with specific permissions. $this->big_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports', 'administer users')); $this->any_user = $this->drupalCreateUser(array()); } diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityApiTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityApiTest.php index a7ac1a99a5c1e858dca8c66e25aa7249433a78dd..6a335c5795be18566c1e09095552f361dbd61084 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityApiTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityApiTest.php @@ -14,6 +14,13 @@ */ class EntityApiTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('entity', 'entity_test'); + public static function getInfo() { return array( 'name' => 'Entity CRUD', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('entity', 'entity_test'); - } - /** * Tests basic CRUD functionality of the Entity API. */ diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityCrudHookTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityCrudHookTest.php index dffa6fda81f5095366dd7408544d0d18ed485703..5f7f5779b7b320bc13d4b1bc7dfbf0045fcae1bc 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityCrudHookTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityCrudHookTest.php @@ -23,6 +23,13 @@ */ class EntityCrudHookTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('entity_crud_hook_test', 'taxonomy', 'comment'); + protected $ids = array(); public static function getInfo() { @@ -33,10 +40,6 @@ public static function getInfo() { ); } - public function setUp() { - parent::setUp('entity_crud_hook_test', 'taxonomy', 'comment'); - } - /** * Checks the order of CRUD hook execution messages. * diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityFieldQueryTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityFieldQueryTest.php index fd609d8eb297ed190d50e252b8b2468c5207ba1c..762551f2065078d0a11f8a0047d28f02f80b29a9 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityFieldQueryTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityFieldQueryTest.php @@ -17,6 +17,12 @@ */ class EntityFieldQueryTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'field_test', 'entity_query_access_test', 'node_access_test'); public static function getInfo() { return array( @@ -27,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'field_test', 'entity_query_access_test', 'node_access_test')); + parent::setUp(); field_test_create_bundle('bundle1'); field_test_create_bundle('bundle2'); diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationTest.php index 6f9ec7a523ce1db4d8464f8d31eff8f34363fe91..9875b39dd0ea37cd5aaaba5d43d6af911ee33eda 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationTest.php @@ -9,7 +9,6 @@ use Exception; use InvalidArgumentException; - use Drupal\simpletest\WebTestBase; /** @@ -17,6 +16,13 @@ */ class EntityTranslationTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('entity_test', 'locale'); + protected $langcodes; public static function getInfo() { @@ -28,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('entity_test', 'locale'); + parent::setUp(); // Enable translations for the test entity type. variable_set('entity_test_translation', TRUE); diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityUUIDTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityUUIDTest.php index c2f42c55489f9dc616892bf0ae40fc258b5fe722..a2771213d9502081c52e2afbb9b6420e19149e29 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityUUIDTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityUUIDTest.php @@ -14,6 +14,14 @@ * Tests creation, saving, and loading of entity UUIDs. */ class EntityUUIDTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('entity_test'); + public static function getInfo() { return array( 'name' => 'Entity UUIDs', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('entity_test')); - } - /** * Tests UUID generation in entity CRUD operations. */ diff --git a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php index 17e879b4ec11e0b31e2e603ab957571e0298d6f6..c7c31a98a1644a5b52351f0c1c784287b295dd4d 100644 --- a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php @@ -13,6 +13,14 @@ * Unit test class for field bulk delete and batch purge functionality. */ class BulkDeleteTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + protected $field; public static function getInfo() { @@ -81,7 +89,7 @@ function checkHooksInvocations($expected_hooks, $actual_hooks) { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); $this->fields = array(); $this->instances = array(); diff --git a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php index 589fe8d54cc8be1d725d8b7a0721611676f134e0..c85cbe6b83761b2fc57f165ff1df58ffeb4b51f4 100644 --- a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php @@ -11,6 +11,14 @@ use Exception; class CrudTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test', 'number'); + public static function getInfo() { return array( 'name' => 'Field CRUD tests', @@ -19,11 +27,6 @@ public static function getInfo() { ); } - function setUp() { - // field_update_field() tests use number.module - parent::setUp('field_test', 'number'); - } - // TODO : test creation with // - a full fledged $field structure, check that all the values are there // - a minimal $field structure, check all default values are set diff --git a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php index c64f11c7b724c8f2e100303c70619bc9fd393ced..9e0de09286f8fcde61b27e7260b7c300b6361cf6 100644 --- a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php @@ -8,6 +8,14 @@ namespace Drupal\field\Tests; class DisplayApiTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + public static function getInfo() { return array( 'name' => 'Field Display API tests', @@ -17,7 +25,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); // Create a field and instance. $this->field_name = 'test_field'; diff --git a/core/modules/field/lib/Drupal/field/Tests/EntityPropertiesTest.php b/core/modules/field/lib/Drupal/field/Tests/EntityPropertiesTest.php index 02f5459174d01f4552abcf1141353829e6531663..85b3d394f3d78b75bfec969fc6dd10466bfe3a2f 100644 --- a/core/modules/field/lib/Drupal/field/Tests/EntityPropertiesTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/EntityPropertiesTest.php @@ -11,6 +11,14 @@ * Tests entity properties. */ class EntityPropertiesTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + public static function getInfo() { return array( 'name' => 'Entity properties', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('field_test'); - } - /** * Tests label key and label callback of an entity. */ diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php index 730b218d807c56b1874c017e45ad5356a1c77115..17c7a3b2827bd852090509821e59831ce94c478b 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php @@ -8,19 +8,16 @@ namespace Drupal\field\Tests; abstract class FieldAttachTestBase extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + function setUp() { - // Since this is a base class for many test cases, support the same - // flexibility that Drupal\simpletest\WebTestBase::setUp() has for the - // modules to be passed in as either an array or a variable number of string - // arguments. - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - if (!in_array('field_test', $modules)) { - $modules[] = 'field_test'; - } - parent::setUp($modules); + parent::setUp(); $this->field_name = drupal_strtolower($this->randomName() . '_field_name'); $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4); diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php index d62412bd52e5907bf523275b54cd198faf27bcc9..7155af9b25d4572cc4c2e1542d5c19397ca82b2c 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php @@ -9,6 +9,13 @@ class FieldInfoTest extends FieldTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + public static function getInfo() { return array( 'name' => 'Field info tests', @@ -17,10 +24,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('field_test'); - } - /** * Test that field types and field definitions are correcly cached. */ diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php index 7d1e66763062f573375a087a6eaeec021b0f93d8..1af2f38fe6083a5f68a30282f43397e02246c304 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php @@ -10,6 +10,14 @@ use Drupal\field\FieldException; class FieldInstanceCrudTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + protected $field; public static function getInfo() { @@ -21,7 +29,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); $this->field = array( 'field_name' => drupal_strtolower($this->randomName()), diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php index c4a9d160a05e3a56533340486d63d1902c8c17eb..666bf42cf7a6cf57dfc9d854836ebd4c95425334 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php @@ -19,15 +19,8 @@ abstract class FieldTestBase extends WebTestBase { * Set the default field storage backend for fields created during tests. */ function setUp() { - // Since this is a base class for many test cases, support the same - // flexibility that Drupal\simpletest\WebTestBase::setUp() has for the - // modules to be passed in as either an array or a variable number of string - // arguments. - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - parent::setUp($modules); + parent::setUp(); + // Set default storage backend. variable_set('field_storage_default', $this->default_storage); } diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php index 94919aa6d46e74c994b3459d6e2db6c7dbbb2098..6b0bf901f2147817495c774e2973105f5457f8b7 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php @@ -8,6 +8,14 @@ namespace Drupal\field\Tests; class FormTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'field_test', 'options'); + public static function getInfo() { return array( 'name' => 'Field form tests', @@ -17,7 +25,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'field_test', 'options')); + parent::setUp(); $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content')); $this->drupalLogin($web_user); diff --git a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php index 44050001dfba32aa6e53ccd1ccb636f80587e460..b63ee4fee179981f1ecd9f9dbbf6295ac0d42d3b 100644 --- a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php @@ -14,6 +14,14 @@ * that only the correct values are returned by field_available_languages(). */ class TranslationTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'field_test'); + public static function getInfo() { return array( 'name' => 'Field translations tests', @@ -23,7 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('language', 'field_test'); + parent::setUp(); $this->field_name = drupal_strtolower($this->randomName() . '_field_name'); diff --git a/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php b/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php index eb30493f6d6757572a761dd050f4801045df69ce..ba0200bdbe810e653e8a4487ade7bbd3bea8437a 100644 --- a/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php +++ b/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php @@ -19,6 +19,14 @@ * for the Field Strage API. */ class FieldSqlStorageTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_sql_storage', 'field', 'field_test', 'text', 'number'); + public static function getInfo() { return array( 'name' => 'Field SQL Storage tests', @@ -28,7 +36,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_sql_storage', 'field', 'field_test', 'text', 'number'); + parent::setUp(); + $this->field_name = strtolower($this->randomName()); $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4); $this->field = field_create_field($this->field); diff --git a/core/modules/field/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php b/core/modules/field/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php index c92970f2dc20973e6358662a67185a29d82b8b0d..64aabe38f6b5590408369ae695aa3dbe7496a80a 100644 --- a/core/modules/field/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php +++ b/core/modules/field/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php @@ -13,6 +13,14 @@ * Tests for number field types. */ class NumberFieldTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'field_test', 'number', 'field_ui'); + protected $field; protected $instance; protected $web_user; @@ -26,7 +34,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'field_test', 'number', 'field_ui')); + parent::setUp(); + $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer content types')); $this->drupalLogin($this->web_user); } diff --git a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php index 3bd77b6fdc7f8a4bf6cb34dddad55bdc118be721..4065b7d03b9718076cab969ab954069147ad54f8 100644 --- a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php +++ b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php @@ -13,8 +13,16 @@ * Sets up a Options field for testing allowed values functions. */ class OptionsDynamicValuesTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('options', 'field_test', 'options_test'); + function setUp() { - parent::setUp(array('options', 'field_test', 'options_test')); + parent::setUp(); $this->field_name = 'test_options'; $this->field = array( diff --git a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php index 047daca7b07ab2f1ed0430ae08131687c45cae67..2965bd70f715c5d0e3649408d1908a610794e4e9 100644 --- a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php +++ b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php @@ -14,6 +14,14 @@ * Tests for the 'Options' field types. */ class OptionsFieldTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('options', 'field_test'); + public static function getInfo() { return array( 'name' => 'Options field', @@ -23,7 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('options', 'field_test')); + parent::setUp(); $this->field_name = 'test_options'; $this->field = array( diff --git a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php index 5ff5aeb1bc3aacee053d8c699e21095697e67013..7416c50622965d1a53398fe07841747dd8a5e11d 100644 --- a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php +++ b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php @@ -13,6 +13,14 @@ * Options module UI tests. */ class OptionsFieldUITest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('options', 'field_test', 'taxonomy', 'field_ui'); + public static function getInfo() { return array( 'name' => 'Options field UI', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('options', 'field_test', 'taxonomy', 'field_ui')); + parent::setUp(); // Create test user. $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy')); diff --git a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php index c2821666ed31b801340ab08ca34d9ba63faf0bbe..dbf72035c25739a8396d6ca62cecae4105ddb42e 100644 --- a/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php +++ b/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php @@ -13,6 +13,14 @@ * Test the Options widgets. */ class OptionsWidgetsTest extends FieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('options', 'field_test', 'options_test', 'taxonomy', 'field_ui'); + public static function getInfo() { return array( 'name' => 'Options widgets', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('options', 'field_test', 'options_test', 'taxonomy', 'field_ui')); + parent::setUp(); // Field with cardinality 1. $this->card_1 = array( diff --git a/core/modules/field/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/field/modules/text/lib/Drupal/text/Tests/TextFieldTest.php index c90abd67dfd0a1e0b78373e27f284317a666ae6a..a2c0e80d550fa1af3075c74a3b7e982ae3da6ca2 100644 --- a/core/modules/field/modules/text/lib/Drupal/text/Tests/TextFieldTest.php +++ b/core/modules/field/modules/text/lib/Drupal/text/Tests/TextFieldTest.php @@ -14,6 +14,14 @@ * Tests the creation of text fields. */ class TextFieldTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + protected $instance; protected $admin_user; protected $web_user; @@ -27,7 +35,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer filters')); $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content')); diff --git a/core/modules/field/modules/text/lib/Drupal/text/Tests/TextTranslationTest.php b/core/modules/field/modules/text/lib/Drupal/text/Tests/TextTranslationTest.php index 0d3739f9eb7dc031e1c66e4d77169899485beab0..c3c696a6084d12143b26639a4d1400474abbabb3 100644 --- a/core/modules/field/modules/text/lib/Drupal/text/Tests/TextTranslationTest.php +++ b/core/modules/field/modules/text/lib/Drupal/text/Tests/TextTranslationTest.php @@ -13,6 +13,14 @@ * Tests text field translation. */ class TextTranslationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('translation'); + protected $profile = 'standard'; public static function getInfo() { @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('translation'); + parent::setUp(); $full_html_format = filter_format_load('full_html'); $this->format = $full_html_format->format; diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/AlterTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/AlterTest.php index e4898dc2fbcb6180d28b837a2c8c064c02d517cb..72e8218aa137fe57aa93bdac70bf1a78e4b1e432 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/AlterTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/AlterTest.php @@ -13,6 +13,14 @@ * Tests custom widget hooks and callbacks on the field administration pages. */ class AlterTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_ui', 'field_test', 'text', 'options'); + public static function getInfo() { return array( 'name' => 'Widget customization', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('field_ui', 'field_test', 'text', 'options')); + parent::setUp(); // Create Article node type. $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php index fab60d76cd2d0432c97c8eb1b02e86619be8f401..06e8dc691456e18a872278a867d7ecf0bdcaafba 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php @@ -13,18 +13,16 @@ * Provides common functionality for the Field UI test classes. */ abstract class FieldUiTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ public static $modules = array('node', 'field_ui', 'field_test', 'taxonomy'); function setUp() { - // Since this is a base class for many test cases, support the same - // flexibility that Drupal\simpletest\WebTestBase::setUp() has for the - // modules to be passed in as either an array or a variable number of string - // arguments. - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - parent::setUp($modules); + parent::setUp(); // Create test user. $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer taxonomy')); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php index 06ea02ad788ca3d7bf57657df1f046f7f18adc7a..40edfa5c110e1f8e17ca25c97c70a445d91111fb 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php @@ -13,6 +13,14 @@ * Tests the functionality of the 'Manage display' screens. */ class ManageDisplayTest extends FieldUiTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('search'); + public static function getInfo() { return array( 'name' => 'Manage display', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('search')); - } - /** * Tests formatter settings. */ diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php index 726156f58b9d671199f8149d61113b327b57ae0c..c85a707c0fbb4cf6aaef2550564e1c21ad5f09bb 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php @@ -13,22 +13,20 @@ * Provides methods specifically for testing File module's field handling. */ abstract class FileFieldTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file', 'file_module_test'); + protected $profile = 'standard'; protected $admin_user; function setUp() { - // Since this is a base class for many test cases, support the same - // flexibility that Drupal\simpletest\WebTestBase::setUp() has for the - // modules to be passed in as either an array or a variable number of string - // arguments. - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'file'; - $modules[] = 'file_module_test'; - parent::setUp($modules); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer nodes', 'bypass node access')); $this->drupalLogin($this->admin_user); } diff --git a/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php b/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php index 2522da67670e6db2a9d17fd60858b5777acf0e67..03226ca59b1994e7425af0539d5e634d21d03e06 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FilePrivateTest.php @@ -11,6 +11,14 @@ * Tests file access on private nodes. */ class FilePrivateTest extends FileFieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public static function getInfo() { return array( 'name' => 'Private file test', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('node_access_test'); + parent::setUp(); node_access_rebuild(); variable_set('node_access_test_private', TRUE); } diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php index 32c706b498dad7b8417fd2186d144beea1ff4636..54369a547936b8f33544c7b45989dba48be98a28 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php @@ -14,6 +14,14 @@ * Tests for text format and filter CRUD operations. */ class FilterCrudTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('filter_test'); + public static function getInfo() { return array( 'name' => 'Filter CRUD operations', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('filter_test'); - } - /** * Test CRUD operations for text formats and filters. */ diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php index 2679132d22288caf9867302ba0df3814d4f4eedb..841c502fd66e1964d5b21464e8b31c7617447c88 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php @@ -13,6 +13,14 @@ * Tests for filter hook invocation. */ class FilterHooksTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'filter_test'); + public static function getInfo() { return array( 'name' => 'Filter format hooks', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('block', 'filter_test'); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer filters', 'administer blocks')); $this->drupalLogin($admin_user); } diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php index 46bb7b66b2ccf8da5106372b876cb6883b18be77..27e0e00b68a803a26c5e9c6f867068f8bd148109 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php @@ -13,6 +13,14 @@ * Security tests for missing/vanished text formats or filters. */ class FilterSecurityTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'php', 'filter_test'); + public static function getInfo() { return array( 'name' => 'Security', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'php', 'filter_test')); + parent::setUp(); // Create Basic page node type. $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php index e7f937dcd3275c9966ee1b15d61a9f980d3e19d0..a9d1a7cd1dd28de958863c39ac2b17965b6b8e43 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php @@ -14,6 +14,13 @@ */ class ForumIndexTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy', 'comment', 'forum'); + public static function getInfo() { return array( 'name' => 'Forum index', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('taxonomy', 'comment', 'forum'); + parent::setUp(); // Create a test user. $web_user = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes')); diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumNodeAccessTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumNodeAccessTest.php index 5cf7071d979ee669f6b234d02805952e87a5e4ce..5ad396aa42d8607819fead31d6da3fbdd9dab09b 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumNodeAccessTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumNodeAccessTest.php @@ -13,6 +13,14 @@ * Tests forum block view for private node access. */ class ForumNodeAccessTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'comment', 'forum', 'taxonomy', 'tracker', 'node_access_test', 'block'); + protected $access_user; protected $admin_user; protected $no_access_user; @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'comment', 'forum', 'taxonomy', 'tracker', 'node_access_test', 'block')); + parent::setUp(); node_access_rebuild(); variable_set('node_access_test_private', TRUE); } diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index 6114cbd9e922e863038572fd1408a2124d5ef5c3..a09ce9200ce6fb9c16be2445476fc5785b51e2db 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -15,6 +15,13 @@ */ class ForumTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu', 'help'); + /** * A user with various administrative privileges. */ @@ -64,7 +71,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('taxonomy', 'comment', 'forum', 'node', 'block', 'menu', 'help')); + parent::setUp(); + // Create users. $this->admin_user = $this->drupalCreateUser(array( 'access administration pages', diff --git a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php index 46c5688657bf69126af0dc6c0b4b6a6c2a04694b..8404d8505522a0636d088de7cd03c84bfb6efb64 100644 --- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php +++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php @@ -13,6 +13,14 @@ * Tests help display and user access for all modules implementing help. */ class HelpTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array. + */ + public static $modules = array('poll'); + // Tests help implementations of many arbitrary core modules. protected $profile = 'standard'; @@ -35,7 +43,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('poll'); + parent::setUp(); $this->getModuleList(); @@ -68,7 +76,7 @@ function testHelp() { $this->assertRaw('<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>', t('Help topics text correctly appears.')); // Make sure links are properly added for modules implementing hook_help(). - foreach ($this->modules as $module => $name) { + foreach ($this->getModuleList() as $module => $name) { $this->assertLink($name, 0, t('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name))); } } @@ -80,7 +88,7 @@ function testHelp() { * An HTTP response code. */ protected function verifyHelp($response = 200) { - foreach ($this->modules as $module => $name) { + foreach ($this->getModuleList() as $module => $name) { // View module help node. $this->drupalGet('admin/help/' . $module); $this->assertResponse($response); @@ -98,13 +106,14 @@ protected function verifyHelp($response = 200) { * A list of enabled modules. */ protected function getModuleList() { - $this->modules = array(); + $modules = array(); $result = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC"); foreach ($result as $module) { if (file_exists($module->filename) && function_exists($module->name . '_help')) { $fullname = unserialize($module->info); - $this->modules[$module->name] = $fullname['name']; + $modules[$module->name] = $fullname['name']; } } + return $modules; } } diff --git a/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php b/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php index 852ed056b1d7e2ea4ce27825f58abe3c369aa58c..933c20f1b91c932bc6438510df5e37f69a8e5202 100644 --- a/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php +++ b/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php @@ -13,6 +13,16 @@ * Tests a module without help to verify it is not listed in the help page. */ class NoHelpTest extends WebTestBase { + + /** + * Modules to enable. + * + * Use one of the test modules that do not implement hook_help(). + * + * @var array. + */ + public static $modules = array('menu_test'); + /** * The user who will be created. */ @@ -27,8 +37,7 @@ public static function getInfo() { } function setUp() { - // Use one of the test modules that do not implement hook_help(). - parent::setUp('menu_test'); + parent::setUp(); $this->big_user = $this->drupalCreateUser(array('access administration pages')); } diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageDimensionsTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageDimensionsTest.php index 0d57e1109441ada340f6bf111b785f961d2c9980..d2554cf68bd7d528d8f6ec6ad95b5c7e30ab26ef 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageDimensionsTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageDimensionsTest.php @@ -13,6 +13,14 @@ * Tests that images have correct dimensions when styled. */ class ImageDimensionsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image', 'image_module_test'); + protected $profile = 'testing'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('image', 'image_module_test')); - } - /** * Test styled image dimensions cumulatively. */ diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageEffectsTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageEffectsTest.php index 0456162fe1d3ba78ab02424c646522acef47b815..fb3269cd553913acacf9752edf1f98e2b8f2f48e 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageEffectsTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageEffectsTest.php @@ -14,6 +14,14 @@ * properly passing parameters to the image toolkit. */ class ImageEffectsTest extends ToolkitTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image_test'); + public static function getInfo() { return array( 'name' => 'Image effects', @@ -23,7 +31,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('image_test'); + parent::setUp(); + module_load_include('inc', 'image', 'image.effects'); } diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php index ed5e9ab4ccd6dfb27370c430525b4eb31cb0a4a9..4d44aa3af8e36b6910311b4156efd205d48f8683 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php @@ -12,6 +12,13 @@ */ class ImageFieldDefaultImagesTest extends ImageFieldTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_ui'); + public static function getInfo() { return array( 'name' => 'Image field default images tests', @@ -20,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('field_ui')); - } - /** * Tests CRUD for fields and fields instances with default images. */ diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php index 2ae34d1315e38c37fd8f40a72bcca01f4315f6a4..39eb53b43e1f89bf3e0839aa1d2924c89d1a786c 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php @@ -11,6 +11,14 @@ * Test class to check that formatters and display settings are working. */ class ImageFieldDisplayTest extends ImageFieldTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_ui'); + public static function getInfo() { return array( 'name' => 'Image field display tests', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('field_ui')); - } - /** * Test image formatters on node display for public files. */ diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php index 86ab992f3b17a937db9208cfdf05815ba11665e5..e78a3644784863f994f792904638b7512d90a734 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php @@ -33,16 +33,18 @@ * This class provides methods specifically for testing Image's field handling. */ abstract class ImageFieldTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'image'); + protected $admin_user; function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'node'; - $modules[] = 'image'; - parent::setUp($modules); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php index 6bf4eb45129cb39926728cd197baa7654382c427..574cc1b9c03a78bc6cd5a35977ae919360f9ff7e 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php @@ -13,6 +13,14 @@ * Tests the functions for generating paths and URLs for image styles. */ class ImageStylesPathAndUrlTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image', 'image_module_test'); + protected $style_name; protected $image_info; protected $image_filepath; @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('image', 'image_module_test')); + parent::setUp(); $this->style_name = 'style_foo'; image_style_save(array('name' => $this->style_name)); diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php index 3c615966de4915ac6595c884963afa8d024de6c5..0e026f2e4cd2ff41e98c53de615fa8d77c984ce4 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php @@ -14,6 +14,13 @@ */ class ImageThemeFunctionTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image'); + public static function getInfo() { return array( 'name' => 'Image theme functions', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('image')); - } - /** * Tests usage of the image field formatters. */ diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php index 1e5f430a621b5f9eaf5c05fb69af2b20e720c642..0372e1bd57719a40dc3f353fe49a0c765120311e 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php @@ -13,6 +13,14 @@ * Functional tests for language configuration's effect on negotiation setup. */ class LanguageConfigurationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Language negotiation autoconfiguration', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('language'); - } - /** * Functional tests for adding, editing and deleting languages. */ diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php index 94015dc0da2dc3026b9c4eba67b68d7b4c30644f..1215cee87c6a718cf313094befebe72bfaa09739 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php @@ -15,6 +15,14 @@ * Test for dependency injected language object. */ class LanguageDependencyInjectionTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Language dependency injection', @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('language'); + parent::setUp(); // Ensure we are building a new Language object for each test. language(NULL, TRUE); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php index 87d6b3b6198301e1726feb4e228658c82d735a78..4b0b5942219fcffe7de583a91ab1b4d12d1607ca 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php @@ -14,6 +14,14 @@ * Functional tests for the language list configuration forms. */ class LanguageListTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Language list configuration', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('language'); - } - /** * Functional tests for adding, editing and deleting languages. */ diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php index d7d68e45fa38239c481c44599d4cd048a5795549..aa6774b906005cb0ab58f5d293c6fc42f9d73167 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php @@ -14,6 +14,13 @@ */ class LanguageNegotiationInfoTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Language negotiation info', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('language'); + parent::setUp(); require_once DRUPAL_ROOT .'/core/includes/language.inc'; $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'view the administration theme')); $this->drupalLogin($admin_user); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php index 4f80277e7df585db406838ab6041624f4628b513..72bbcf1a638cad6a0502054d01df20fb7de849d6 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php @@ -13,6 +13,14 @@ * Tests that paths are not prefixed on a monolingual site. */ class LanguagePathMonolingualTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'path'); + public static function getInfo() { return array( 'name' => 'Paths on non-English monolingual sites', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('path', 'language'); + parent::setUp(); // Create and login user. $web_user = $this->drupalCreateUser(array('administer languages', 'access administration pages')); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php index c8c67327aa51b07c1c6796edb4817edcfaa2d23d..efe643d728086c4397d05d3ab9fd279d3b70e9f8 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php @@ -14,6 +14,13 @@ */ class LanguageSwitchingTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'block'); + public static function getInfo() { return array( 'name' => 'Language switching', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('language', 'block')); + parent::setUp(); // Create and login user. $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer languages', 'access administration pages')); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php index 02d5139eacdc4669eeb0f662fc6ddf4c17e97861..d12bdfaa0436a2315bdf8e8794226925e9356809 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php @@ -36,6 +36,18 @@ * UI language in Chinese */ class LanguageUILanguageNegotiationTest extends WebTestBase { + + /** + * Modules to enable. + * + * We marginally use interface translation functionality here, so need to use + * the locale module instead of language only, but the 90% of the test is + * about the negotiation process which is solely in language module. + * + * @var array + */ + public static $modules = array('locale', 'language_test', 'block'); + public static function getInfo() { return array( 'name' => 'UI language negotiation', @@ -45,10 +57,7 @@ public static function getInfo() { } function setUp() { - // We marginally use interface translation functionality here, so need to - // use the locale module instead of language only, but the 90% of the test - // is about the negotiation process which is solely in language module. - parent::setUp(array('locale', 'language_test', 'block')); + parent::setUp(); require_once DRUPAL_ROOT . '/core/includes/language.inc'; $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages', 'administer blocks')); $this->drupalLogin($admin_user); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php index 04ed724e678baf1e7aedf17b1ef575b467bf133a..72f21165532ad96bd7cb310ac1761ddeba6630e4 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php @@ -13,6 +13,14 @@ * Test that URL rewriting works as expected. */ class LanguageUrlRewritingTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'URL rewriting', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('language'); + parent::setUp(); // Create and login user. $this->web_user = $this->drupalCreateUser(array('administer languages', 'access administration pages')); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCommentLanguageTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCommentLanguageTest.php index 9bb8bc0cc57c2eff634eea6a2d034ec25e76010a..6776e31e54b4d61bf3f2b93fb9cbe6a6b659db86 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCommentLanguageTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCommentLanguageTest.php @@ -13,6 +13,18 @@ * Functional tests for comment language. */ class LocaleCommentLanguageTest extends WebTestBase { + + /** + * Modules to enable. + * + * We also use the language_test module here to be able to turn on content + * language negotiation. Drupal core does not provide a way in itself to do + * that. + * + * @var array + */ + public static $modules = array('locale', 'language_test'); + protected $profile = 'standard'; public static function getInfo() { @@ -24,10 +36,7 @@ public static function getInfo() { } function setUp() { - // We also use language_test module here to be able to turn on content - // language negotiation. Drupal core does not provide a way in itself - // to do that. - parent::setUp('locale', 'language_test'); + parent::setUp(); // Create and login user. $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'create article content')); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php index fbedc33a73b03cf6063cf2474e4ae48bb67cc65b..a41d68b669761ded974f8b1647ba152c309e8da6 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php @@ -13,6 +13,14 @@ * Functional tests for multilingual support on nodes. */ class LocaleContentTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + protected $profile = 'standard'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('locale'); - } - /** * Verifies that machine name fields are always LTR. */ diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php index 4ad935669e473bdb0338635857aa9f18df9f576d..673867f708773a79effc618355db2c4304993710 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php @@ -13,6 +13,14 @@ * Tests for the export of translation files. */ class LocaleExportTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Translation export', @@ -27,7 +35,7 @@ public static function getInfo() { protected $admin_user = NULL; function setUp() { - parent::setUp('locale'); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php index 2126b262679906ae942536089ccbce0f2b6be7cd..a19351da7ca20feaa4aab33087385b3ed76eccf6 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php @@ -13,6 +13,14 @@ * Functional tests for the import of translation files. */ class LocaleFileImportStatus extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Translation file import status', @@ -22,8 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('locale'); - + parent::setUp(); // Create and login user. $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages')); $this->drupalLogin($admin_user); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 016082a8a4884c15ebbd2789699c1f91520e2530..589c555edf0a58911d6f76e7757ca8dc7e15889a 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -13,6 +13,14 @@ * Functional tests for the import of translation files. */ class LocaleImportFunctionalTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale', 'dblog'); + public static function getInfo() { return array( 'name' => 'Translation import', @@ -27,8 +35,7 @@ public static function getInfo() { protected $admin_user = NULL; function setUp() { - parent::setUp(array('locale', 'dblog')); - + parent::setUp(); // Set the translation file directory. variable_set('locale_translate_file_directory', drupal_get_path('module', 'locale') . '/tests'); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleInstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleInstallTest.php index f1677eb21e4292d5a1d7949e4514cd9f9074405c..fa6aafc88f471cfa9d4c7a8a057ad5722dcdc1ba 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleInstallTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleInstallTest.php @@ -14,6 +14,14 @@ * Tests for the st() function. */ class LocaleInstallTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'String translation using st()', @@ -23,8 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('locale'); - + parent::setUp(); // st() lives in install.inc, so ensure that it is loaded for all tests. require_once DRUPAL_ROOT . '/core/includes/install.inc'; } diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php index 97395379f1815ec1cc613f88e16b4c9c6cdaabc8..89622670fb5b94a67934abe8af9057af3c406848 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php @@ -13,6 +13,14 @@ * Functional tests for JavaScript parsing for translatable strings. */ class LocaleJavascriptTranslation extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Javascript translation', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('locale'); - } - function testFileParsing() { $filename = drupal_get_path('module', 'locale') . '/tests/locale_test.js'; diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php index 2e1ae8c9a40aea50fe45b253faef16d37343df16..e1e478777d303a35129bf7fe06d9e87afc0d458e 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php @@ -14,6 +14,14 @@ * Currently, only the jQuery datepicker is localized using Drupal translations. */ class LocaleLibraryInfoAlterTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Javascript library localisation', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('locale')); - } - /** * Verifies that the datepicker can be localized. * diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php index 61c45721dae479f43a33cbadf41fcd00d304b40c..7e9786a1c29a63dfe0138b6eff4e9b35a833dabe 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php @@ -13,6 +13,14 @@ * Functional tests for configuring a different path alias per language. */ class LocalePathTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'locale', 'path'); + public static function getInfo() { return array( 'name' => 'Path language settings', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'locale', 'path')); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); config('system.site')->set('page.front', 'node')->save(); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php index 32e0ab41426e48ea2dcda33ca69a83844c9aba51..f4a56e236766f00c5f7e9ba58b8ab83c38bc3804 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php @@ -13,6 +13,14 @@ * Tests plural format handling functionality. */ class LocalePluralFormatTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Plural handling', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('locale'); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages')); $this->drupalLogin($admin_user); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php index 212f32e0b0315a9870f1926974ee54376607d7b8..1c7265cbfed4792b02faeac11e8a572b3ed92bda 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php @@ -13,6 +13,14 @@ * Functional test for string translation and validation. */ class LocaleTranslationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'String translate, search and validate', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('locale'); - } - /** * Adds a language and tests string translation by users with the appropriate permissions. */ diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php index 9092bf4d07fb137ed0e0038ebce38e0d432e0541..00fb2b0f6580e3e345230ab3f70e0d0eee89efb4 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php @@ -13,6 +13,14 @@ * Locale uninstall with English UI functional test. */ class LocaleUninstallTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'locale'); + public static function getInfo() { return array( 'name' => 'Locale uninstall (EN)', @@ -27,7 +35,8 @@ public static function getInfo() { protected $language; function setUp() { - parent::setUp(array('node', 'locale')); + parent::setUp(); + $this->langcode = 'en'; // Create Article node type. diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php index 28ca83213342a67cdb16175cd3c750b754634ed7..4d2d1ad22ef8841f396dc6fc7c47b0bff3cd7c88 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuNodeTest.php @@ -13,6 +13,14 @@ * Test menu settings for nodes. */ class MenuNodeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('menu'); + protected $profile = 'standard'; public static function getInfo() { @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('menu'); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array( 'access administration pages', diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index e8fce502010d328f1e935e850e0eabc5ad6466c9..579b09e103966dec6dcba92db0861734f117b25e 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class MenuTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('menu'); + protected $profile = 'standard'; protected $big_user; @@ -26,7 +34,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('menu'); + parent::setUp(); + // Create users. $this->big_user = $this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content')); $this->std_user = $this->drupalCreateUser(array()); diff --git a/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php index d84d1f30570aac2ece41864a891750b3d755ffa0..abb31f379dc3d9df817c049251fd6d35a0817802 100644 --- a/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php @@ -13,6 +13,14 @@ * Test multistep node forms basic options. */ class MultiStepNodeFormBasicOptionsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('poll'); + public static function getInfo() { return array( 'name' => 'Multistep node form basic options', @@ -22,7 +30,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('poll'); + parent::setUp(); + $web_user = $this->drupalCreateUser(array('administer nodes', 'create poll content')); $this->drupalLogin($web_user); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php index 10cdc544e86bc4777b9b2c744c7d7e636a5e2c3e..e5253a880ee13fd30278de83174067afc07b400d 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php @@ -11,6 +11,14 @@ * Tests for Node Access with a non-node base table. */ class NodeAccessBaseTableTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + // Requires tags taxonomy field. protected $profile = 'standard'; @@ -26,7 +34,8 @@ public static function getInfo() { * Enable modules and create user with specific permissions. */ public function setUp() { - parent::setUp('node_access_test'); + parent::setUp(); + node_access_rebuild(); variable_set('node_access_test_private', TRUE); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php index cc7d7927e55161ad8c6c083883740afe93c34c3b..3d11e26fb1639db64b1a2711ca53b6828fba0148 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessFieldTest.php @@ -12,6 +12,13 @@ */ class NodeAccessFieldTest extends NodeTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test', 'field_ui'); + public static function getInfo() { return array( 'name' => 'Node access and fields', @@ -21,7 +28,8 @@ public static function getInfo() { } public function setUp() { - parent::setUp('node_access_test', 'field_ui'); + parent::setUp(); + node_access_rebuild(); // Create some users. diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php index 77b96d6b091af6201df2542fde1ad03c5e9b5957..8a6ce9916f2ef33c7cdc97d76a9d31d26d5e6a08 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php @@ -11,6 +11,14 @@ * Test case to verify node_access functionality for multiple languages. */ class NodeAccessLanguageTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'node_access_test'); + public static function getInfo() { return array( 'name' => 'Node access language', @@ -30,7 +38,8 @@ function assertNodeAccess($ops, $node, $account, $langcode = NULL) { } function setUp() { - parent::setUp(array('language', 'node_access_test')); + parent::setUp(); + // Clear permissions for authenticated users. db_delete('role_permission') ->condition('rid', DRUPAL_AUTHENTICATED_RID) diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php index 42c32d3efcea5ae204d0d870a57db4a12e26c58a..640f9e077ac8828c793f899882ff6e75fe9d6950 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php @@ -14,6 +14,13 @@ */ class NodeAccessPagerTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test', 'comment', 'forum'); + public static function getInfo() { return array( 'name' => 'Node access pagination', @@ -23,7 +30,8 @@ public static function getInfo() { } public function setUp() { - parent::setUp('node_access_test', 'comment', 'forum'); + parent::setUp(); + node_access_rebuild(); $this->web_user = $this->drupalCreateUser(array('access content', 'access comments', 'node test view')); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php index 7bd8c1de2dbb9407d1ad2ceda667b2ca968c0c17..4c5598ae372f35c3c47986f2b33eb4a52e0ffbab 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php @@ -11,6 +11,14 @@ * Test case to verify hook_node_access_records functionality. */ class NodeAccessRecordsTest extends NodeTestBase { + + /** + * Enable a module that implements node access API hooks and alter hook. + * + * @var array + */ + public static $modules = array('node_test'); + public static function getInfo() { return array( 'name' => 'Node access records', @@ -19,13 +27,6 @@ public static function getInfo() { ); } - function setUp() { - // Enable dummy module that implements hook_node_grants(), - // hook_node_access_records(), hook_node_grants_alter() and - // hook_node_access_records_alter(). - parent::setUp('node_test'); - } - /** * Create a node and test the creation of node access rules. */ diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php index 6ff9b7229f9d3da6cdf18f58666591f57b7cfc4a..0c86de2b97224d798979e83ac520aabc0cd83b16 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php @@ -11,6 +11,14 @@ * Functional tests for the node module blocks. */ class NodeBlockFunctionalTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Node blocks', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create users and test node. $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer nodes', 'administer blocks')); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php index 3a7229308c75bec1520ff03d01d4f0e34095fa41..9aca3cfedb686bd89f99ee19dd7ff95b6720503b 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php @@ -8,6 +8,14 @@ namespace Drupal\node\Tests; class NodeBlockTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Block availability', @@ -17,7 +25,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create and login user $admin_user = $this->drupalCreateUser(array('administer blocks')); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php index f66b2acecdaf1a069a159a0b37e15d77a4410f52..a8fbb07bd4569785b53032a55064792c6500ea13 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php @@ -11,6 +11,16 @@ use Exception; class NodeCreationTest extends NodeTestBase { + + /** + * Modules to enable. + * + * Enable dummy module that implements hook_node_insert() for exceptions. + * + * @var array + */ + public static $modules = array('node_test_exception', 'dblog'); + public static function getInfo() { return array( 'name' => 'Node creation', @@ -20,8 +30,7 @@ public static function getInfo() { } function setUp() { - // Enable dummy module that implements hook_node_insert for exceptions. - parent::setUp(array('node_test_exception', 'dblog')); + parent::setUp(); $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content')); $this->drupalLogin($web_user); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeEntityFieldQueryAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeEntityFieldQueryAlterTest.php index 5e3f0b8f6e303c8961b4f9c9f03dfdd2bac14876..2333dd93714e199868d83cb5a56226f0297b933d 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeEntityFieldQueryAlterTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeEntityFieldQueryAlterTest.php @@ -12,6 +12,13 @@ */ class NodeEntityFieldQueryAlterTest extends NodeTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public static function getInfo() { return array( 'name' => 'Node entity query alter', @@ -31,7 +38,7 @@ public static function getInfo() { protected $noAccessUser; function setUp() { - parent::setUp('node_access_test'); + parent::setUp(); node_access_rebuild(); // Creating 4 nodes with an entity field so we can test that sort of query diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php index df1ce3ebb0511f396f158ad387edefa737374e0e..f51342b6be17a0d7af1926419bc8d73e576decf1 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php @@ -13,6 +13,14 @@ * Functional test for multilingual fields. */ class NodeFieldMultilingualTestCase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'language'); + public static function getInfo() { return array( 'name' => 'Multilingual fields', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'language')); + parent::setUp(); // Create Basic page node type. $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php index 4e94992c7b460ae4aae4428d97bf8aa0e150148a..36b99da83c0d208a55567efe5c335e2857cd4fdf 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeLoadHooksTest.php @@ -11,6 +11,14 @@ * Tests for the hooks invoked during node_load(). */ class NodeLoadHooksTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_test'); + public static function getInfo() { return array( 'name' => 'Node load hooks', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('node_test'); - } - /** * Tests that hook_node_load() is invoked correctly. */ diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php index dc6d95aba5b94a792572b59ba1b64d1a037ede52..6d149dd539840071926c6fe3a32f324ee6021c5d 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php @@ -14,6 +14,13 @@ */ class NodeQueryAlterTest extends NodeTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public static function getInfo() { return array( 'name' => 'Node query alter', @@ -33,7 +40,8 @@ public static function getInfo() { protected $noAccessUser; function setUp() { - parent::setUp('node_access_test'); + parent::setUp(); + node_access_rebuild(); // Create some content. diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php index 8577b2bf70fbadffa2302d51aab30c8e718d0d8a..97b3b252a8f8b51b191ca7f672ea018833f7a8a2 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php @@ -15,6 +15,14 @@ * sitewide RSS feed at rss.xml. */ class NodeRSSContentTest extends NodeTestBase { + + /** + * Enable a module that implements hook_node_view(). + * + * @var array + */ + public static $modules = array('node_test'); + public static function getInfo() { return array( 'name' => 'Node RSS Content', @@ -24,8 +32,7 @@ public static function getInfo() { } function setUp() { - // Enable dummy module that implements hook_node_view. - parent::setUp('node_test'); + parent::setUp(); // Use bypass node access permission here, because the test class uses // hook_grants_alter() to deny access to everyone on node_access diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php index 9dcebf9ae852b801bb041a55c82a83debc61cd8c..116ca18927329018f849a53ac3ef62bcdde621da 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeSaveTest.php @@ -12,6 +12,13 @@ */ class NodeSaveTest extends NodeTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_test'); + public static function getInfo() { return array( 'name' => 'Node save', @@ -21,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('node_test'); + parent::setUp(); + // Create a user that is allowed to post; we'll use this to test the submission. $web_user = $this->drupalCreateUser(array('create article content')); $this->drupalLogin($web_user); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php b/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php index 25eac6175e59f78ad638c2191e1a6ef4009c7184..3c3927920ee63681b26acef06cc77f104c172c6c 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php @@ -10,13 +10,16 @@ use Drupal\simpletest\WebTestBase; abstract class NodeTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'node'; - parent::setUp($modules); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php index 5ebe6cfe850c46c2af4cac7a0f37e0af072a2b97..1880d4f9d262bf0a7aff164905a42480a6e86c63 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTitleTest.php @@ -11,6 +11,14 @@ * Test node title. */ class NodeTitleTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment'); + protected $admin_user; public static function getInfo() { @@ -22,7 +30,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('comment')); + parent::setUp(); + $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content', 'post comments')); $this->drupalLogin($this->admin_user); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php index 39db014c67f0a2361e4b82c1ea843b39eb59ace6..434384fed7fd54cb3d9e34de3a19010ba12b72f8 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeInitialLanguageTest.php @@ -11,6 +11,14 @@ * Tests related to node type initial language. */ class NodeTypeInitialLanguageTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Node type initial language', @@ -20,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('language')); + parent::setUp(); + $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer languages')); $this->drupalLogin($web_user); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php index e84a93081366b9eafe5f5bff17baa1f460c90cb0..a2ef01aac5bedd9447cb02b351a380382d6e4a08 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php @@ -11,6 +11,14 @@ * Tests related to node types. */ class NodeTypeTest extends NodeTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_ui'); + public static function getInfo() { return array( 'name' => 'Node types', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('field_ui')); - } - /** * Ensure that node type functions (node_type_get_*) work correctly. * diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php index 8b479f0bbdd81ee530179b92e62b8ccdf050b735..f977de526f2a2375339b1f07c30b671d72a4c219 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php @@ -13,6 +13,14 @@ * Test discovery and login using OpenID */ class OpenIDFunctionalTest extends OpenIDTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('openid_test'); + protected $web_user; public static function getInfo() { @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('openid', 'openid_test'); + parent::setUp(); // User doesn't need special permissions; only the ability to log in. $this->web_user = $this->drupalCreateUser(array()); diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php index a143d34259706a53a6231716c72edbe26514a7eb..c46676d2eb1294a8344dd7358d7a177c168d8e08 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDRegistrationTest.php @@ -11,6 +11,16 @@ * Test account registration using Simple Registration and Attribute Exchange. */ class OpenIDRegistrationTest extends OpenIDTestBase { + + /** + * Modules to enable. + * + * Add language module to test with some non-built-in languages. + * + * @var array + */ + public static $modules = array('openid_test', 'language'); + public static function getInfo() { return array( 'name' => 'OpenID account registration', @@ -20,8 +30,7 @@ public static function getInfo() { } function setUp() { - // Add language module too to test with some non-built-in languages. - parent::setUp('openid', 'openid_test', 'language'); + parent::setUp(); variable_set('user_register', USER_REGISTER_VISITORS); } diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTest.php index 595dca424c52f5d8fc9355344594f0fd1ab5041b..8ed7a98834033b73b2053124f1be883ef772874a 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTest.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTest.php @@ -14,6 +14,14 @@ * Test internal helper functions. */ class OpenIDTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('openid'); + public static function getInfo() { return array( 'name' => 'OpenID helper functions', @@ -23,7 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('openid'); + parent::setUp(); module_load_include('inc', 'openid'); } diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php index 302c1595149b4af2d5f3fff7b995a9ebc5e5e411..3a01d334bb3aa1f7637d130d7ebcd6eeef1dd511 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php @@ -13,14 +13,16 @@ * Base class for OpenID tests. */ abstract class OpenIDTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'openid'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'block'; - $modules[] = 'openid'; - parent::setUp($modules); + parent::setUp(); // Enable user login block. db_merge('block') diff --git a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php index 5444d2bacf17c8cbf03acf6d9324d5345d74a2e8..dcaf94569b8492e5973c656b40e8a5b789ec5b1a 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php @@ -11,6 +11,14 @@ * Tests path alias functionality. */ class PathAliasTest extends PathTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('path'); + public static function getInfo() { return array( 'name' => 'Path alias functionality', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('path'); + parent::setUp(); // Create test user and login. $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content', 'administer url aliases', 'create url aliases')); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index d550575891121beca614c8d8d0a3c73a3f65d187..09518ab9e87a7662fc53b150170329f566e12e6b 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -11,6 +11,14 @@ * Tests URL aliases for translated nodes. */ class PathLanguageTest extends PathTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('path', 'locale', 'translation'); + public static function getInfo() { return array( 'name' => 'Path aliases with translated nodes', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('path', 'locale', 'translation'); + parent::setUp(); // Create and login user. $this->web_user = $this->drupalCreateUser(array('edit any page content', 'create page content', 'administer url aliases', 'create url aliases', 'administer languages', 'translate content', 'access administration pages')); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php index f1f56d6210836d2d3ab8261a63da3c08219a9ef0..bd0d279f84d3b72bb5e5059a4afeac193a486ac7 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php @@ -11,6 +11,14 @@ * Tests the user interface for creating path aliases, with languages. */ class PathLanguageUiTest extends PathTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('path', 'locale'); + public static function getInfo() { return array( 'name' => 'Path aliases with languages', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('path', 'locale'); + parent::setUp(); // Create and login user. $web_user = $this->drupalCreateUser(array('edit any page content', 'create page content', 'administer url aliases', 'create url aliases', 'administer languages', 'access administration pages')); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php b/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php index fffb7eaad6f336a5ac053437a1eeb5fe69736599..421870d150aeaf5422d5c951b9e6e9e96133ded9 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php @@ -11,6 +11,14 @@ * Tests URL aliases for taxonomy terms. */ class PathTaxonomyTermTest extends PathTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy'); + public static function getInfo() { return array( 'name' => 'Taxonomy term URL aliases', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('taxonomy')); + parent::setUp(); // Create a Tags vocabulary for the Article node type. $vocabulary = entity_create('taxonomy_vocabulary', array( diff --git a/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php b/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php index 480257219b821539a78256ebebe1623a8a9c92d6..97f3f81b31c4173bc4cbadb4192ea33c5f88ce8f 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php @@ -13,14 +13,16 @@ * Provides a base class for testing the Path module. */ abstract class PathTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'path'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'node'; - $modules[] = 'path'; - parent::setUp($modules); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php b/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php index 675b146bed5a30f51a1a50c4efefddcc1d3762ba..c35fd3030fbd2da1a95f4b3dd9a70571383e6ce4 100644 --- a/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php +++ b/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php @@ -13,10 +13,18 @@ * Defines a base PHP test case class. */ abstract class PhpTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('php'); + protected $php_code_format; function setUp() { - parent::setUp('php'); + parent::setUp(); // Create Basic page node type. $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php b/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php index 65380152948eacb7c03f52c3b2e95bc14f08de9e..7d9dcd6f89e4f786d69ad845c4c1631609d9bdb7 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php @@ -8,6 +8,14 @@ namespace Drupal\poll\Tests; class PollBlockTest extends PollTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Block availability', @@ -17,7 +25,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create and login user $admin_user = $this->drupalCreateUser(array('administer blocks')); diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollJsAddChoiceTest.php b/core/modules/poll/lib/Drupal/poll/Tests/PollJsAddChoiceTest.php index 7410958f0be4f58560daf10ac7e48b88e0b01de2..6d2d6154a6b37b211b355607c73d07de8fe96e32 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollJsAddChoiceTest.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollJsAddChoiceTest.php @@ -14,6 +14,13 @@ */ class PollJsAddChoiceTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('poll'); + public static function getInfo() { return array( 'name' => 'Poll add choice', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('poll')); - } - /** * Test adding a new choice. */ diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollTestBase.php b/core/modules/poll/lib/Drupal/poll/Tests/PollTestBase.php index c2ed0a4440bd5900471ea2c08d3f3ef2a1ee0a04..cd519b840a6cd12ee15203a3dfdd59fafa355990 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollTestBase.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollTestBase.php @@ -10,15 +10,13 @@ use Drupal\simpletest\WebTestBase; abstract class PollTestBase extends WebTestBase { - function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'node'; - $modules[] = 'poll'; - parent::setUp($modules); - } + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'poll'); /** * Creates a poll. diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollTranslateTest.php b/core/modules/poll/lib/Drupal/poll/Tests/PollTranslateTest.php index ee1d4d7542d5a983e3a3cd89af8b9355dd2e7a91..819b5f7bab5c2fc4447ab0475e20b60ecae9042c 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollTranslateTest.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollTranslateTest.php @@ -11,6 +11,14 @@ * Tests poll translation logic. */ class PollTranslateTest extends PollTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('translation'); + public static function getInfo() { return array( 'name' => 'Poll translation', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('translation')); - } - /** * Tests poll creation and translation. * diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php index d4df881da9b4eeb780b402704e1ba202d83fde7b..e765436b06bafc4acf7edb47d727f02d8e94459e 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php @@ -14,6 +14,13 @@ */ class CommentAttributesTest extends CommentTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment', 'rdf', 'rdf_test'); + public static function getInfo() { return array( 'name' => 'RDF comment mapping', @@ -23,7 +30,7 @@ public static function getInfo() { } public function setUp() { - parent::setUp('comment', 'rdf', 'rdf_test'); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer permissions', 'administer blocks')); $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'access user profiles')); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php index 8716b19d191096490cdab584b438d644b091d12b..3e52bd9c8860ace1d8de3b5bf1687249bba776d9 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php @@ -13,6 +13,14 @@ * Tests the RDF mapping CRUD functions. */ class CrudTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test'); + public static function getInfo() { return array( 'name' => 'RDF mapping CRUD functions', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'rdf_test'); - } - /** * Tests inserting, loading, updating, and deleting RDF mappings. */ diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php index 9bfe966520fa5cf208221302e2bfe3426692e43b..36a288583d89327e7e926809e39890cd2e0bc45e 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetNamespacesTest.php @@ -13,6 +13,14 @@ * Tests for RDF namespaces XML serialization. */ class GetNamespacesTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test'); + public static function getInfo() { return array( 'name' => 'RDF namespaces serialization test', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'rdf_test'); - } - /** * Tests RDF namespaces. */ diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php index 73abc1e2c0572d5f033f446464ca78c41f2de0cd..cca794f4c72b5e74c5fc321363531191f7158a2a 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php @@ -13,6 +13,14 @@ * Tests for RDF namespaces declaration with hook_rdf_namespaces(). */ class GetRdfNamespacesTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test'); + public static function getInfo() { return array( 'name' => 'RDF namespaces', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'rdf_test'); - } - /** * Tests getting RDF namesapces. */ diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php index 8d646c34f444097d02583ffa2adc13cc8eb1a442..f4c70286c1285120ec16a868652ce48a98c009db 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingDefinitionTest.php @@ -13,6 +13,14 @@ * Tests the RDF mapping definition functionality. */ class MappingDefinitionTest extends TaxonomyTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test'); + protected $profile = 'standard'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'rdf_test'); - } - /** * Create a node of type article and test whether the RDF mapping defined for * this node type in rdf_test.module is used in the node page. diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php index 1ee8436f7c2aec562996b5ccb5a5bf8c387e9759..e29d54518352d1afae4231296f9e7f422a61c31d 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php @@ -13,6 +13,14 @@ * Tests the RDF mapping hook. */ class MappingHookTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test', 'field_test'); + public static function getInfo() { return array( 'name' => 'RDF mapping hook', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'rdf_test', 'field_test'); - } - /** * Tests that hook_rdf_mapping() correctly returns and processes mapping. */ diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php index 024bb5dca302bfdb80383bf4c0160719f83d7726..a7ea42698566d257315679386ba95296bffe4b98 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php @@ -13,6 +13,14 @@ * Tests RDFa markup generation. */ class RdfaMarkupTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'field_test', 'rdf_test'); + protected $profile = 'standard'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('rdf', 'field_test', 'rdf_test'); - } - /** * Tests rdf_rdfa_attributes(). */ diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php index fdac25403ede3ff966c634b8db3b26deeb0aa48c..f5e306cdb14e46caf86e918bd1f86d837bcf2d61 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php @@ -14,6 +14,14 @@ * Tests the RDF tracker page mapping. */ class TrackerAttributesTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rdf', 'rdf_test', 'tracker'); + protected $profile = 'standard'; public static function getInfo() { @@ -25,7 +33,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('rdf', 'rdf_test', 'tracker'); + parent::setUp(); + // Enable anonymous posting of content. user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array( 'create article content' => TRUE, diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php index d2eac83c2374d516f87c2b854665825f62748862..93bb9a67b4cf54f9c5e2559da438d88eb681dca4 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchBlockTest.php @@ -8,6 +8,14 @@ namespace Drupal\search\Tests; class SearchBlockTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'Block availability', @@ -17,7 +25,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create and login user $admin_user = $this->drupalCreateUser(array('administer blocks', 'search content')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php index ecf16d2f0eb840794e212456055602cad12d5f4e..cb35b068992723d7f15632c554f7b5ce0754b314 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentCountToggleTest.php @@ -18,6 +18,14 @@ * - Nodes with comment status set to Hidden should never show comment counts */ class SearchCommentCountToggleTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment'); + // Requires node types, comment config, filter formats. protected $profile = 'standard'; @@ -33,7 +41,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('comment')); + parent::setUp(); // Create searching user. $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php index 16e74e57dcb372505ce0de62183c522659a488b5..59e5a277f488e722989f22ae98ef9e7885ebe066 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php @@ -11,6 +11,14 @@ * Test integration searching comments. */ class SearchCommentTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment'); + protected $profile = 'standard'; protected $admin_user; @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('comment')); + parent::setUp(); // Create and log in an administrative user having access to the Full HTML // text format. diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php index db615852fdba7c9762a50360fa4521f1d5345d7f..7c123a0a3dd1a2b438827e3b343e472216e855ea 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php @@ -11,6 +11,14 @@ * Test config page. */ class SearchConfigSettingsFormTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'search_extra_type'); + public $search_user; public $search_node; @@ -23,7 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'search_extra_type')); + parent::setUp(); // Login as a user that can create and search content. $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php index 84e9ffc4f3143082f06b7fdc453fcf7911f0420c..ff822c6b4eb3ba79c0d44d2609116330a54ec4b4 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php @@ -11,6 +11,14 @@ * Tests that we can embed a form in search results and submit it. */ class SearchEmbedFormTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('search_embedded_form'); + /** * Node used for testing. */ @@ -30,7 +38,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('search_embedded_form')); + parent::setUp(); // Create a user and a node, and update the search index. $test_user = $this->drupalCreateUser(array('access content', 'search content', 'administer nodes')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php index db18ce8ab357c86c1f9782336f685406eba347de..87414faaa3a736d92c69ccbfe657c977a4c4a7f9 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php @@ -11,6 +11,14 @@ * Tests keywords and conditions. */ class SearchKeywordsConditionsTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment', 'search_extra_type'); + public static function getInfo() { return array( 'name' => 'Keywords and conditions', @@ -20,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('comment', 'search_extra_type')); + parent::setUp(); + // Create searching user. $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval')); // Login with sufficient privileges. diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php index f117729ff1b7a5ab7a14c2be418188fddbe44cc1..4047c425c9208768ef84dceac724b37e19fd0178 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php @@ -11,6 +11,14 @@ * Test node search with multiple languages. */ class SearchLanguageTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Search language selection', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('language')); + parent::setUp(); // Create and login user. $test_user = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search', 'administer nodes', 'administer languages', 'access administration pages')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php index 955c358eafdbb866c27d50527b61ae551d59ff3f..19c94cb8c7e9e163a936a9e075977a5a1d0674d6 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php @@ -11,6 +11,14 @@ * Tests node search with node access control. */ class SearchNodeAccessTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public $test_user; public static function getInfo() { @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node_access_test')); + parent::setUp(); node_access_rebuild(); // Create a test user and log in. diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php index a604494adf63ff2d5c22bdef4f7ea63c5edffb90..df72d2bd5ee7f057164915aa4c77f921f36549e8 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php @@ -11,6 +11,14 @@ * Tests that hook_search_page runs. */ class SearchPageOverrideTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('search_extra_type'); + public $search_user; public static function getInfo() { @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('search_extra_type')); + parent::setUp(); // Login as a user that can create and search content. $this->search_user = $this->drupalCreateUser(array('search content', 'administer search')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php index 75e0628451477af06fc110677db680c4ff1de9e6..a57e4836f3d470c175d23d42cf307f35f0206f7f 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php @@ -8,6 +8,14 @@ namespace Drupal\search\Tests; class SearchRankingTest extends SearchTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('statistics', 'comment'); + public static function getInfo() { return array( 'name' => 'Search engine ranking', @@ -16,10 +24,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('statistics', 'comment')); - } - function testRankings() { // Login with sufficient privileges. $this->drupalLogin($this->drupalCreateUser(array('post comments', 'skip comment approval', 'create page content'))); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchTestBase.php b/core/modules/search/lib/Drupal/search/Tests/SearchTestBase.php index 35da57aff0ca25b139aab67dc238f863389fcb4f..1f8013a9d7cc646e9a3f891828d2b2c0ac99588b 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchTestBase.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchTestBase.php @@ -10,15 +10,16 @@ use Drupal\simpletest\WebTestBase; abstract class SearchTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'search', 'dblog'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'node'; - $modules[] = 'search'; - $modules[] = 'dblog'; - parent::setUp($modules); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php index 4aca686c8bdf4f083edff6084b27586dd4c644cb..a300866cda0cc519085ccdbd181ead0deb27ffc5 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php @@ -15,6 +15,13 @@ */ abstract class ShortcutTestBase extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('toolbar', 'shortcut'); + /** * User with permission to administer shortcuts. */ @@ -36,7 +43,7 @@ abstract class ShortcutTestBase extends WebTestBase { protected $set; function setUp() { - parent::setUp('toolbar', 'shortcut'); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrokenSetUpTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrokenSetUpTest.php index 866a6e9dca2456252073741d1757b6327c257763..af9303abe8c31d0b06fd9d1951348397423515ef 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrokenSetUpTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrokenSetUpTest.php @@ -20,6 +20,14 @@ * @see Drupal\simpletest\WebTestBase */ class BrokenSetUpTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + public static function getInfo() { return array( 'name' => 'Broken SimpleTest method', @@ -31,7 +39,7 @@ public static function getInfo() { function setUp() { // If the test is being run from the main site, set up normally. if (!drupal_valid_test_ua()) { - parent::setUp('simpletest'); + parent::setUp(); // Create and log in user. $admin_user = $this->drupalCreateUser(array('administer unit tests')); $this->drupalLogin($admin_user); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/FolderTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/FolderTest.php index b6ceca6a7b64a6f13b60018582a447bf4b7f298a..f49868b0e3fe9916c59f61625af702ebbb9b4046 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/FolderTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/FolderTest.php @@ -13,6 +13,14 @@ * Test Folder creation */ class FolderTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image'); + public static function getInfo() { return array( 'name' => 'Testing SimpleTest setUp', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - return parent::setUp('image'); - } - function testFolderSetup() { $directory = file_default_scheme() . '://styles'; $this->assertTrue(file_prepare_directory($directory, FALSE), "Directory created."); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/InstallationProfileModuleTestsTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/InstallationProfileModuleTestsTest.php index 674428db0388dc0d4a6a79aa6dbd471c8d84bb81..5af5c0d96d72946897ce2da55de648a50384a50a 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/InstallationProfileModuleTestsTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/InstallationProfileModuleTestsTest.php @@ -13,6 +13,14 @@ * Verifies that tests bundled with installation profile modules are found. */ class InstallationProfileModuleTestsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + /** * Use the Testing profile. * @@ -36,7 +44,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('simpletest')); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer unit tests')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingCheckedRequirementsTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingCheckedRequirementsTest.php index 665b1e664aaa3b6a938a988ec0b0f5364cf95a6e..b43aeceab9c9c57d08062cb7abaf734dc16ebf23 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingCheckedRequirementsTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MissingCheckedRequirementsTest.php @@ -13,6 +13,14 @@ * Tests missing requirements to run test. */ class MissingCheckedRequirementsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + public static function getInfo() { return array( 'name' => 'Broken requirements test', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('simpletest'); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer unit tests')); $this->drupalLogin($admin_user); } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfileModuleTestsTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfileModuleTestsTest.php index a2036e5a28da5510a6e1af8d6f8a7795bebcc60a..7f01be2038752f046350de3f88c2894e2feaeaab 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfileModuleTestsTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/OtherInstallationProfileModuleTestsTest.php @@ -15,6 +15,14 @@ * @see SimpleTestInstallationProfileModuleTestsTestCase */ class OtherInstallationProfileModuleTestsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + /** * Use the Minimal profile. * @@ -35,7 +43,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('simpletest')); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer unit tests')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php index 938054a75b63c10d22694bf9a8c3ba1ff52c682a..3f5f2643e33d07813f51e63ed110966deb63d651 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php @@ -11,6 +11,14 @@ use SimpleXMLElement; class SimpleTestTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + /** * The results array that has been parsed by getTestResults(). */ @@ -32,14 +40,14 @@ public static function getInfo() { function setUp() { if (!$this->inCURL()) { - parent::setUp('simpletest'); - + parent::setUp(); // Create and login user $admin_user = $this->drupalCreateUser(array('administer unit tests')); $this->drupalLogin($admin_user); } else { - parent::setUp('non_existent_module'); + self::$modules = array('non_existent_module'); + parent::setUp(); } } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 877c3cbf708a9ec9e2bb41dec0c3aafcbff2efdc..bb2aef8612bd347493c9eadad95cd5ce892726fa 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -634,15 +634,9 @@ protected function setUp() { // Install the modules specified by the testing profile. module_enable($profile_details['dependencies'], FALSE); - // Install modules needed for this test. This could have been passed in as - // either a single array argument or a variable number of string arguments. - // @todo Remove this after fully converting to static $modules property. - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } // Collect modules to install. $class = get_class($this); + $modules = array(); while ($class) { if (property_exists($class, 'modules')) { $modules = array_merge($modules, $class::$modules); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php index d1a8d9c6dc0f944fecd8a911a1593ec2f6a0e561..a24ec9580fc62eb97cefb4df5533389552dd4b2c 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php @@ -14,6 +14,13 @@ */ class StatisticsAdminTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'statistics'); + /** * A user that has permission to administer and access statistics. * @@ -39,7 +46,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'statistics')); + parent::setUp(); // Create Basic page node type. if ($this->profile != 'standard') { diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php index 8ac2fb6398c8ffb3e11d46468676a4bccd8b8cef..cb0a08ee301cb4414ee8f968e46a3dd862668399 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php @@ -17,6 +17,14 @@ * want to test requests from an anonymous user. */ class StatisticsLoggingTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('statistics', 'block'); + public static function getInfo() { return array( 'name' => 'Statistics logging tests', @@ -26,7 +34,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('statistics', 'block')); + parent::setUp(); // Create Basic page node type. if ($this->profile != 'standard') { diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php index c1a4bc1cb5a578d7799eeb32876dea1e00d161a7..b7e2d31e82e2cf0bfaf50f44fb72fe903dfe1da9 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php @@ -14,8 +14,15 @@ */ abstract class StatisticsTestBase extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'block', 'statistics'); + function setUp() { - parent::setUp(array('node', 'block', 'statistics')); + parent::setUp(); // Create Basic page node type. if ($this->profile != 'standard') { diff --git a/core/modules/syslog/lib/Drupal/syslog/Tests/SyslogTest.php b/core/modules/syslog/lib/Drupal/syslog/Tests/SyslogTest.php index dd719bcbf1cf829e853506ccf2ffa68fa4f71747..1bb928390dc0ea89806b6c9373e1982ed3222653 100644 --- a/core/modules/syslog/lib/Drupal/syslog/Tests/SyslogTest.php +++ b/core/modules/syslog/lib/Drupal/syslog/Tests/SyslogTest.php @@ -13,6 +13,14 @@ * Tests the Syslog module functionality. */ class SyslogTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('syslog'); + public static function getInfo() { return array( 'name' => 'Syslog functionality', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('syslog'); - } - /** * Tests the syslog settings page. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Actions/LoopTest.php b/core/modules/system/lib/Drupal/system/Tests/Actions/LoopTest.php index 2a6ff0ab4762a20f164514e3acf60fecb1ee629b..86d99f9fc5d98f0de4725f268feed455014db60d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Actions/LoopTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Actions/LoopTest.php @@ -13,6 +13,14 @@ * Test actions executing in a potential loop, and make sure they abort properly. */ class LoopTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('dblog', 'actions_loop_test'); + protected $aid; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('dblog', 'actions_loop_test'); - } - /** * Set up a loop with 3 - 12 recursions, and see if it aborts properly. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php index f517a23e2a74cf4d11589459bddfef52c2519d76..1aef68a4a760f3a21e390b619819ecfeb8110b11 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php @@ -13,13 +13,13 @@ * Base test system for AJAX tests. */ abstract class AjaxTestBase extends WebTestBase { - function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - parent::setUp(array_unique(array_merge(array('ajax_test', 'ajax_forms_test'), $modules))); - } + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('ajax_test', 'ajax_forms_test'); /** * Assert that a command with the required properties exists within the array of Ajax commands returned by the server. diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/MultiFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/MultiFormTest.php index fa0fc32148262750fd05906acec2a9373378a10b..dd4700c1202b5e53aea30046c33b9e61b5c90022 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/MultiFormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/MultiFormTest.php @@ -11,6 +11,14 @@ * Tests that Ajax-enabled forms work when multiple instances of the same form are on a page. */ class MultiFormTest extends AjaxTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + protected $profile = 'standard'; public static function getInfo() { @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('form_test')); + parent::setUp(); // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php index bef4812e61c71a7183c299053f0b316c69904666..b901239c49976b94eb01f959602252610a265a06 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php @@ -13,6 +13,14 @@ * Tests for the Batch API Progress page. */ class PageTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('batch_test'); + public static function getInfo() { return array( 'name' => 'Batch progress page', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('batch_test'); - } - /** * Tests that the batch API progress page uses the correct theme. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php index 13315ca9ee35f06f2e7daea7f1dbea03f8c9a16e..af0a1de6ecdc7e041b555f09363b7d73b93167c5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php @@ -13,6 +13,14 @@ * Tests for the Batch API. */ class ProcessingTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('batch_test'); + public static function getInfo() { return array( 'name' => 'Batch processing', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('batch_test'); - } - /** * Test batches triggered outside of form submission. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/HookBootExitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/HookBootExitTest.php index 0c1f840af358809327be44bed52511c608dfd5d5..e75dada0c67f86cda71a89e2ed9f65e1419ea6e1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/HookBootExitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/HookBootExitTest.php @@ -14,6 +14,13 @@ */ class HookBootExitTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test', 'dblog'); + public static function getInfo() { return array( 'name' => 'Boot and exit hook invocation', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('system_test', 'dblog'); - } - /** * Test calling of hook_boot() and hook_exit(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php index 4a0cfb76a5096bb742448e27d8eee211cb870d0c..91543b9d95d7ebf551b15ddeef63b62b391b8533 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php @@ -14,6 +14,13 @@ */ class PageCacheTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'system_test'); + public static function getInfo() { return array( 'name' => 'Page cache test', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'system_test')); + parent::setUp(); config('system.site') ->set('name', 'Drupal') diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/VariableTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/VariableTest.php index cf77d23d4172000473bc677904962b0b552cba83..93502438e673e88e44bb193ca9c97fd434efee07 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/VariableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/VariableTest.php @@ -14,9 +14,12 @@ */ class VariableTest extends WebTestBase { - function setUp() { - parent::setUp('system_test'); - } + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test'); public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Bundle/BundleTest.php b/core/modules/system/lib/Drupal/system/Tests/Bundle/BundleTest.php index fef908c5511b775a9f52f7b1f914fc949f990e90..4aeea00e9dc6ec7b7b7c9593d69056333e94ab7c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bundle/BundleTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bundle/BundleTest.php @@ -13,6 +13,14 @@ * Test bundle registration to the DIC. */ class BundleTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('bundle_test'); + public static function getInfo() { return array( 'name' => 'Bundle Registration', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('bundle_test'); - } - /** * Test that services provided by module bundles get registered to the DIC. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/InstallTest.php index b6907e25393d4999661567b6145298550d1f7103..72caa5a524098d883b64039391e2d4a7d67dd00e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Cache/InstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Cache/InstallTest.php @@ -14,6 +14,14 @@ * Tests the behavior of the cache backend used for installing Drupal. */ class InstallTest extends CacheTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('cache_test'); + protected $profile = 'testing'; public static function getInfo() { @@ -24,10 +32,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('cache_test')); - } - /** * Tests the behavior of the cache backend used for installing Drupal. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php index ac135561d83a0fbf8283922d1c10e344e71b9e9e..b8a498cc77242553b965baea4bf31c95b428fe06 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php @@ -14,6 +14,14 @@ * Tests alteration of arguments passed to drupal_alter(). */ class AlterTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'common_test'); + public static function getInfo() { return array( 'name' => 'Alter hook functionality', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('block', 'common_test')); - } - function testDrupalAlter() { // This test depends on Bartik, so make sure that it is always the current // active theme. diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php index 5742a7e0d7278e14fa774cb39f7d6fcafc011111..94216829f0802d8d86045354641e57ba6905a4e5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php @@ -13,6 +13,14 @@ * Tests the Drupal CSS system. */ class CascadingStylesheetsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language', 'common_test'); + public static function getInfo() { return array( 'name' => 'Cascading stylesheets', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('language', 'common_test')); + parent::setUp(); // Reset drupal_add_css() before each test. drupal_static_reset('drupal_add_css'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php index ab94150c0da3172eff4452f7c0eaac66c61f2b19..9639758f4e2e7569b10a56c290c83200c2b2102f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php @@ -14,6 +14,13 @@ */ class FormatDateTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + /** * Arbitrary langcode for a custom language. */ @@ -28,7 +35,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('language'); + parent::setUp(); variable_set('configurable_timezones', 1); variable_set('date_format_long', 'l, j. F Y - G:i'); variable_set('date_format_medium', 'j. F Y - G:i'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php index 16ffccd48392d1b7cca35861622307281cd189fe..f1c4fbe3689c41ffd3b3d82e83e2b96c8cbc197e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php @@ -13,6 +13,14 @@ * Tests drupal_goto() and hook_drupal_goto_alter(). */ class GotoTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('common_test'); + public static function getInfo() { return array( 'name' => 'Redirect functionality', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('common_test'); - } - /** * Test drupal_goto(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/HttpRequestTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/HttpRequestTest.php index f6c37c7030a9c0b9d1f6909f101d5cc3fab9c7a6..276d82e9a5e26c68216b19ebe4e1e1a2a029bd5d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/HttpRequestTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/HttpRequestTest.php @@ -13,6 +13,14 @@ * Tests drupal_http_request(). */ class HttpRequestTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test', 'language'); + public static function getInfo() { return array( 'name' => 'Drupal HTTP request', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('system_test', 'language'); - } - function testDrupalHTTPRequest() { global $is_https; diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php index 9d002144fbb61e79b98717c37a9c894bd47442b2..1b071749ec6a29ba7ea97a1c0d2143e3e172773b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php @@ -13,6 +13,14 @@ * Tests the JavaScript system. */ class JavaScriptTest extends WebTestBase { + + /** + * Enable Language and SimpleTest in the test environment. + * + * @var array + */ + public static $modules = array('language', 'simpletest', 'common_test', 'path'); + /** * Store configured value for JavaScript preprocessing. */ @@ -27,8 +35,7 @@ public static function getInfo() { } function setUp() { - // Enable Language and SimpleTest in the test environment. - parent::setUp('language', 'simpletest', 'common_test', 'path'); + parent::setUp(); // Disable preprocessing $config = config('system.performance'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index f80d8401f276e231d98d72f77f36070dd3027775..ec3d95bf25f4cd230478265e2287c32d86aa160c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -13,6 +13,14 @@ * Tests drupal_render(). */ class RenderTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('common_test'); + public static function getInfo() { return array( 'name' => 'drupal_render()', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('common_test'); - } - /** * Test sorting by weight. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php index 352d708125d2a9d8dee3c49e927d0702c49a9009..22333749e5936e82a17b329a5be27ae3ab50e75c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php @@ -14,6 +14,13 @@ */ class SimpleTestErrorCollectorTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test', 'error_test'); + /** * Errors triggered during the test. * @@ -32,10 +39,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('system_test', 'error_test'); - } - /** * Test that simpletest collects errors from the tested site. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php index 79f20a0e96c3874426683aa926eff02e02374f4a..e0324370eff92ccbbff75b0ec7d6a82ed2c2d730 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php @@ -14,6 +14,14 @@ * Tests writing of data records with drupal_write_record(). */ class WriteRecordTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('database_test'); + public static function getInfo() { return array( 'name' => 'Data record write functionality', @@ -22,10 +30,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('database_test'); - } - /** * Test the drupal_write_record() API function. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php index 2fff06bfe4a2dd0ad03f6b64dc8449d8135b9330..c9c2d8cbee13c924886527598877b7866621fa44 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php @@ -16,13 +16,16 @@ * here. */ abstract class DatabaseTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('database_test'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'database_test'; - parent::setUp($modules); + parent::setUp(); $schema['test'] = drupal_get_schema('test'); $schema['test_people'] = drupal_get_schema('test_people'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/RangeQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/RangeQueryTest.php index 57bc025e980aa7d532a547c41d46ac5b11338d75..91d6c97477a3162db3c677bd337868bef339812a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Database/RangeQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/RangeQueryTest.php @@ -13,6 +13,14 @@ * Range query tests. */ class RangeQueryTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('database_test'); + public static function getInfo() { return array( 'name' => 'Range query test', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('database_test'); - } - /** * Confirm that range query work and return correct result. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/RegressionTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/RegressionTest.php index 0c36cb3049481966a5776c596319bf9ca864092f..6553379108aadb570bd5663563592fa53b00921b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Database/RegressionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/RegressionTest.php @@ -12,6 +12,13 @@ */ class RegressionTest extends DatabaseTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + public static function getInfo() { return array( 'name' => 'Regression tests', @@ -20,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('node')); - } - /** * Regression test for #310447. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php index 8b8e6fdfa322c8373e5d364c27d1e036c6ab07d3..e389e28d7a69f2c690a6c4cea66696ddb98f2ac8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php @@ -12,6 +12,13 @@ */ class SelectComplexTest extends DatabaseTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node_access_test'); + public static function getInfo() { return array( 'name' => 'Select tests, complex', @@ -20,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('node_access_test')); - } - /** * Test simple JOIN statements. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/TemporaryQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/TemporaryQueryTest.php index 784f2db1f2176caa708d769bcf0277a327d0a15a..24a61fa67982b20608c074483ea7a663ce97fb9f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Database/TemporaryQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/TemporaryQueryTest.php @@ -13,6 +13,14 @@ * Temporary query tests. */ class TemporaryQueryTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('database_test'); + public static function getInfo() { return array( 'name' => 'Temporary query test', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('database_test'); - } - /** * Return the number of rows of a table. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/File/DownloadTest.php b/core/modules/system/lib/Drupal/system/Tests/File/DownloadTest.php index acfa06207da37682c6a2d1ece1633a2cbe92a53b..a2bc1e560504af6a6f429c6027a3d6cf1ef06ad1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/DownloadTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/DownloadTest.php @@ -11,6 +11,14 @@ * Tests for download/file transfer functions. */ class DownloadTest extends FileTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { return array( 'name' => 'File download', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); // Clear out any hook calls. file_test_reset(); } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/FileHookTestBase.php b/core/modules/system/lib/Drupal/system/Tests/File/FileHookTestBase.php index 3f387fe36bd667173878ef0887a01a5a6cf4c673..cde558dc4784c3449a5446f8f90c7bf90ff47d20 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/FileHookTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/FileHookTestBase.php @@ -12,9 +12,17 @@ * hooks. */ abstract class FileHookTestBase extends FileTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + function setUp() { // Install file_test module - parent::setUp('file_test'); + parent::setUp(); // Clear out any hook calls. file_test_reset(); } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php b/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php index b2703eb28d5c9e5948be380d1fed1eff8cc6ce76..8a33ea6f3b1427141ab5905bd46e78138bcd2a6f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php @@ -17,10 +17,7 @@ abstract class FileTestBase extends WebTestBase { function setUp() { - $modules = func_get_args(); - $modules = (isset($modules[0]) && is_array($modules[0]) ? $modules[0] : $modules); - parent::setUp($modules); - + parent::setUp(); // Make sure that custom stream wrappers are registered. // @todo This has the potential to be a major bug deeply buried in File API; // file_unmanaged_*() API functions and test functions are invoking native diff --git a/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php b/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php index cb90b85c7745ed9de3f8415bdc867f0f4cc808ce..6eb2e7340a10fa983ca2b2acc278b250584b8663 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php @@ -13,9 +13,13 @@ * Tests for file_get_mimetype(). */ class MimeTypeTest extends WebTestBase { - function setUp() { - parent::setUp('file_test'); - } + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php index 1a2ef4889f08d0030ab0f6779a8d1cfbf8e0abd3..89f9019239805b2459497e12210803356c887572 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php @@ -11,6 +11,14 @@ * Directory related tests. */ class RemoteFileDirectoryTest extends DirectoryTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileSaveUploadTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileSaveUploadTest.php index dd4eb49405efbf89d45d58dbf813be8afaab8dc7..3e71f0a54a90d657b440ecb91b33478712e72662 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileSaveUploadTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileSaveUploadTest.php @@ -11,6 +11,14 @@ * Tests the file_save_upload() function on remote filesystems. */ class RemoteFileSaveUploadTest extends SaveUploadTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php index 75fa9049ce8f5dd067098f6943e4db772cf395c8..279d722a742581670bbd7f85ddbe27e819a4a3dc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php @@ -11,6 +11,14 @@ * Tests the file_scan_directory() function on remote filesystems. */ class RemoteFileScanDirectoryTest extends ScanDirectoryTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php index 5aff075a6a6d66a78e08b4b07ac5d58d60461d63..3f58ef40828e51fb28f019484185c97ef818bb43 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php @@ -11,6 +11,14 @@ * Unmanaged copy related tests on remote filesystems. */ class RemoteFileUnmanagedCopyTest extends UnmanagedCopyTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php index 081dc3d04acc70327e66f6eee8c47941a45f7d17..d45210e1c7a79676ec1c16235155d35de15f76da 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php @@ -11,6 +11,14 @@ * Deletion related tests on remote filesystems. */ class RemoteFileUnmanagedDeleteRecursiveTest extends UnmanagedDeleteRecursiveTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php index 44dbf1438ff1c341eb6f05e22e4b14c7c636ee66..ea52cfed3f463f3f5444a6b99ee2f5d0447b4ee0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php @@ -11,6 +11,14 @@ * Deletion related tests on remote filesystems. */ class RemoteFileUnmanagedDeleteTest extends UnmanagedDeleteTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedMoveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedMoveTest.php index fd53fd83e117e52e3b542e9fdedbb43dc4c0f236..c900fcf96f9e328df7ee92fe44524b5a6645d24d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedMoveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedMoveTest.php @@ -11,6 +11,14 @@ * Unmanaged move related tests on remote filesystems. */ class RemoteFileUnmanagedMoveTest extends UnmanagedMoveTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php index 3463e6a6f88270e212a3d8c08e6b2783bfe0b997..b66932b1a53afe353d4979a9acab1debca63ca74 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php @@ -11,6 +11,14 @@ * Tests the file_unmanaged_save_data() function on remote filesystems. */ class RemoteFileUnmanagedSaveDataTest extends UnmanagedSaveDataTest { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { $info = parent::getInfo(); $info['group'] = 'File API (remote)'; @@ -18,7 +26,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); variable_set('file_default_scheme', 'dummy-remote'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/ScanDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/ScanDirectoryTest.php index dda40fd9929f547508c34a657fcb992687fae1b6..4954d8e61a4eae88ab3fdcbec7350e3b18049873 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/ScanDirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/ScanDirectoryTest.php @@ -11,6 +11,14 @@ * Tests the file_scan_directory() function. */ class ScanDirectoryTest extends FileTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { return array( 'name' => 'File scan directory', @@ -20,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('file_test')); + parent::setUp(); $this->path = drupal_get_path('module', 'simpletest') . '/files'; } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php index 5a4d58dfcbb24468038ddf8e095a5c57b0ed44a5..0cbe2c0e00883b863d15362863694fcd0e1ced60 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php @@ -14,6 +14,13 @@ */ class StreamWrapperTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + protected $scheme = 'dummy'; protected $classname = 'Drupal\file_test\DummyStreamWrapper'; @@ -26,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('file_test'); + parent::setUp(); drupal_static_reset('file_get_stream_wrappers'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UrlRewritingTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UrlRewritingTest.php index eb0d99a0134b9d8b016f0171290697152bee625c..4273f7fd0290c4ed7fa5c4dbe9e31889d4e1fa65 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UrlRewritingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UrlRewritingTest.php @@ -11,6 +11,14 @@ * Tests for file URL rewriting. */ class UrlRewritingTest extends FileTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file_test'); + public static function getInfo() { return array( 'name' => 'File URL rewriting', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('file_test'); - } - /** * Test the generating of rewritten shipped file URLs. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/AlterTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/AlterTest.php index 6c6c44b5b4479d8899bf92e68c7a35f39eb2a213..3e45d5b779f09d7ff6929adb9c8b37ff2b21bf30 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/AlterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/AlterTest.php @@ -13,6 +13,14 @@ * Test form alter hooks. */ class AlterTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'form_test'); + public static function getInfo() { return array( 'name' => 'Form alter hooks', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('block', 'form_test')); - } - /** * Tests execution order of hook_form_alter() and hook_form_FORM_ID_alter(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php index d6be705db35b7c7fc9b72973c37ad6dfc906d4fa..824f829b4501aa71e6b1019033d1ba334561e6c7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php @@ -13,6 +13,14 @@ * Tests rebuilding of arbitrary forms by altering them. */ class ArbitraryRebuildTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Rebuild arbitrary forms', @@ -22,7 +30,8 @@ public static function getInfo() { } function setUp() { - parent::setUp('form_test'); + parent::setUp(); + // Auto-create a field for testing. $field = array( 'field_name' => 'test_multiple', diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php index ad229549c78c104e20c208afd8409f756b4bd42a..df0171b9f45b10e46967131bf7a4f023a0083ea5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php @@ -14,6 +14,13 @@ */ class CheckboxTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form API checkbox', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - function testFormCheckbox() { // Ensure that the checked state is determined and rendered correctly for // tricky combinations of default and return values. diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php index cac8d2cc9b7cbfcc58c5a48ee9d2667e3cea1985..3c4c4af86f3e4f09c374a91cc79da8efec54ad0b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php @@ -13,6 +13,14 @@ * Tests building and processing of core form elements. */ class ElementTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Element processing', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('form_test')); - } - /** * Tests placeholder text for elements that support placeholders. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsLabelsTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsLabelsTest.php index 982f1826b2633f18235e569f46a4240da0adc119..7fcc45f61863fea720af27ae70672b13241c5c18 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsLabelsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsLabelsTest.php @@ -14,6 +14,13 @@ */ class ElementsLabelsTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form element and label output test', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Test form elements, labels, title attibutes and required marks output * correctly and have the correct label option class if needed. diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php index 2748836cc1d1935a875a8978c6da7e68162af22b..67c069496596952739cf439399b544382978c3a6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php @@ -14,6 +14,13 @@ */ class ElementsTableSelectTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Tableselect form element type test', @@ -22,11 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - - /** * Test the display of checkboxes when #multiple is TRUE. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsVerticalTabsTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsVerticalTabsTest.php index b517ffc6f8df4fd02d1cdbc07e182317aa9e7129..9c16ec32a768c66ac13da9ef819c0ea90707a350 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsVerticalTabsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsVerticalTabsTest.php @@ -14,6 +14,13 @@ */ class ElementsVerticalTabsTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Vertical tabs form element type test', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Ensures that vertical-tabs.js is included before collapse.js. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php index 7cb6b9bf3456010c1ae3a59b744045a7932711f9..f0dcd9957af37e254cd26efde1f715e46d109c80 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php @@ -13,6 +13,14 @@ * Tests email element. */ class EmailTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + protected $profile = 'testing'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Tests that #type 'email' fields are properly validated. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php index 588241ad8d197da8a8705664aebfc9c86b531f4f..4dad9372eac8e8c8f4dbd9af7c00dd0f1640b0fd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php @@ -14,6 +14,13 @@ */ class FileInclusionTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form API file inclusion', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Tests loading an include specified in hook_menu(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php index 65a265ad673d41690a366ff4999646ca8d7a3381..3fc5bd42df3e45b06b8013b09cb4c4d779a3dd75 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php @@ -11,6 +11,13 @@ class FormTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test', 'file'); + public static function getInfo() { return array( 'name' => 'Form element validation', @@ -20,7 +27,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('form_test', 'file')); + parent::setUp(); $filtered_html_format = array( 'format' => 'filtered_html', diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php index 99192315c53c8bcf657e14dfe14335fc4fa90c6c..3f5a684d2e539ef7332201a1bf873c46208abaeb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php @@ -14,6 +14,13 @@ */ class ProgrammaticTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Programmatic form submissions', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Test the programmatic form submission workflow. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/RebuildTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/RebuildTest.php index 93d3b21a59872a7a22d36d129fd7c7f977d71310..9d4c439a276ef2546b471bbd7c46794260da18b0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/RebuildTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/RebuildTest.php @@ -15,6 +15,14 @@ * @todo Add tests for other aspects of form rebuilding. */ class RebuildTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form rebuilding', @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('form_test'); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/RedirectTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/RedirectTest.php index 646e539ab4b8397fef8c810e3928c4c12942de38..f11291b2a9c8437c0ede775f695ff0169e5e9c04 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/RedirectTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/RedirectTest.php @@ -14,6 +14,13 @@ */ class RedirectTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form redirecting', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('form_test')); - } - /** * Tests form redirection. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanAdvancedTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanAdvancedTest.php index ef3694ebccab33efc68114f52a5c0ad9edee4c31..630a902c06ac04f6bb5b2a928e5a697b075f7331 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanAdvancedTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanAdvancedTest.php @@ -13,6 +13,14 @@ * Tests $form_state clearance with form elements having buttons. */ class StateValuesCleanAdvancedTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('file', 'form_test'); + /** * An image file path for uploading. */ @@ -26,10 +34,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('file', 'form_test')); - } - /** * Tests form_state_values_clean(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php index 15a6952340bda78e2b6bd1112dde54400018be7b..bb9cc2e20a8a177043253a329eb697edb2db8ad0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php @@ -13,6 +13,14 @@ * Test $form_state clearance. */ class StateValuesCleanTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form state values clearance', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Tests form_state_values_clean(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/StorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/StorageTest.php index f51838a1f5c4d92b5362c54c7586fec7ef8d0239..2b1daf991357c153cccc51c82737bf73a90acd61 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/StorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/StorageTest.php @@ -20,6 +20,13 @@ */ class StorageTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Multistep form using form storage', @@ -29,7 +36,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('form_test'); + parent::setUp(); $this->web_user = $this->drupalCreateUser(array('access content')); $this->drupalLogin($this->web_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/TriggeringElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/TriggeringElementTest.php index 99b1f6d314d375e2c6071196c36f9822d0cbff28..25245e959475ba176135955db0c85fbdd056754d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/TriggeringElementTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/TriggeringElementTest.php @@ -14,6 +14,13 @@ */ class TriggeringElementTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form triggering element determination', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Test the determination of $form_state['triggering_element'] when no button * information is included in the POST data, as is sometimes the case when diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php index 03d0105466a74417b9c7d0cbd870b3af30723cc4..4d4696ad1ee8ba13171139085c2e3dbee75c62d1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php @@ -13,6 +13,14 @@ * Tests url element. */ class UrlTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + protected $profile = 'testing'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - public function setUp() { - parent::setUp('form_test'); - } - /** * Tests that #type 'url' fields are properly validated and trimmed. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php index 2386a8edb060ae9333c129c683ac5bc39c668873..7491df286e0d03d1a6765ad465009e53ebe94622 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php @@ -13,6 +13,14 @@ * Test form validation handlers. */ class ValidationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form validation handlers', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Tests form alterations by #element_validate, #validate, and form_set_value(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/WrapperTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/WrapperTest.php index 794e8f76a83905ab5c8eaf28a067996f38cd0965..638c480870553f57a6616d89727e9d4df621715f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/WrapperTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/WrapperTest.php @@ -13,6 +13,14 @@ * Test wrapper form callbacks. */ class WrapperTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('form_test'); + public static function getInfo() { return array( 'name' => 'Form wrapper callback', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('form_test'); - } - /** * Tests using the form in a usual way. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php index 477475bb5eeec385820b36669f729d4d28e59261..ac470805cdd5f6ffb4fceba1eb4d391a3890544a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php @@ -14,12 +14,20 @@ * Base class for image manipulation testing. */ abstract class ToolkitTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image_test'); + protected $toolkit; protected $file; protected $image; function setUp() { - parent::setUp('image_test'); + parent::setUp(); // Use the image_test.module's test toolkit. $this->toolkit = 'test'; diff --git a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php index 9eb77808ee3fb38a10375ddf2e5f41ad4f608656..3f81867588e42755a4b8af761d4eb3c7b5ab413d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Lock/LockFunctionalTest.php @@ -14,6 +14,13 @@ */ class LockFunctionalTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test'); + public static function getInfo() { return array( 'name' => 'Locking framework tests', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('system_test'); - } - /** * Tests backend release functionality. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php index 00a164c84c94cc779a495e664f93bed4dc24a335..d75b5936fe3fe0a27d1cd3f3d9c6d5d668b72b0b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php @@ -14,6 +14,14 @@ * Defines a mail class used for testing. */ class MailTest extends WebTestBase implements MailInterface { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('simpletest'); + /** * The most recent message that was sent through the test case. * @@ -31,7 +39,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('simpletest')); + parent::setUp(); // Set MailTestCase (i.e. this class) as the SMTP library variable_set('mail_system', array('default-system' => 'Drupal\system\Tests\Mail\MailTest')); diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php index d0830a3c17e903e1c284b8f43ecd68c87753a877..fedbafdae1d53143b0e77d448f3ef6bbe52b600f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php @@ -11,6 +11,14 @@ * Menu breadcrumbs related tests. */ class BreadcrumbTest extends MenuTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('menu_test'); + protected $profile = 'standard'; public static function getInfo() { @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('menu_test')); + parent::setUp(); $perms = array_keys(module_invoke_all('permission')); $this->admin_user = $this->drupalCreateUser($perms); diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php index 217150e3921494ad528ff7bc7574acacc39f494f..978ffe0a112d096add722cd90d6cb8ca5a4243fa 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php @@ -10,14 +10,6 @@ use Drupal\simpletest\WebTestBase; abstract class MenuTestBase extends WebTestBase { - function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - parent::setUp($modules); - } - /** * Assert that a given path shows certain breadcrumb links. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php index 11db04ef76eca358ffe37b710e09f36cec4ef062..780298c82112a55a70ebd1ec585560a0aecdb773 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php @@ -14,6 +14,14 @@ * Tests menu router and hook_menu() functionality. */ class RouterTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'menu_test'); + public static function getInfo() { return array( 'name' => 'Menu router', @@ -24,7 +32,7 @@ public static function getInfo() { function setUp() { // Enable dummy module that implements hook_menu. - parent::setUp(array('block', 'menu_test')); + parent::setUp(); // Make the tests below more robust by explicitly setting the default theme // and administrative theme that they expect. diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php index f6164c972fa534cf9cf2c190b78c415b6d25b3c8..cf96b861dd66f5a7450e4dba86498b16dd47b568 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php @@ -11,6 +11,14 @@ * Tests active menu trails. */ class TrailTest extends MenuTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'menu_test'); + public static function getInfo() { return array( 'name' => 'Active trail', @@ -20,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'menu_test')); + parent::setUp(); + $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php index a5a9939c6d5a66881aa52069b2182eb7da0f4ca6..29e5322275083e8a4df946f455715031f0ee8811 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php @@ -13,6 +13,14 @@ * Unit tests for module installation. */ class InstallTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('module_test'); + public static function getInfo() { return array( 'name' => 'Module installation', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('module_test'); - } - /** * Test that calls to drupal_write_record() work during module installation. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php index dff77e81d4b25a2355f28b5a53b7466168dfd480..16987373c767c4902c6c361c11d47230e562b0c5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php @@ -16,10 +16,18 @@ * Helper class for module test cases. */ abstract class ModuleTestBase extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test'); + protected $admin_user; function setUp() { - parent::setUp('system_test'); + parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer modules')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/UninstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/UninstallTest.php index 98bed37e5b6b7aea22998e7fc344e7106d2de38a..dca3bf37c31ca99f29da7a14fc5e06bc927e718d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/UninstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/UninstallTest.php @@ -13,6 +13,14 @@ * Unit tests for module uninstallation and related hooks. */ class UninstallTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('module_test', 'user'); + public static function getInfo() { return array( 'name' => 'Module uninstallation', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('module_test', 'user'); - } - /** * Tests the hook_modules_uninstalled() of the user module. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/VersionTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/VersionTest.php index f7b4bd211879c9f9066cc9a5e65bde68d466dbc8..e32871260ab7f908a9fbdd91b1b2a1320055c7ed 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/VersionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/VersionTest.php @@ -11,6 +11,14 @@ * Test module dependency on specific versions. */ class VersionTest extends ModuleTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('module_test'); + public static function getInfo() { return array( 'name' => 'Module versions', @@ -19,10 +27,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('module_test'); - } - /** * Test version dependencies. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Pager/PagerTest.php b/core/modules/system/lib/Drupal/system/Tests/Pager/PagerTest.php index 4a83d4a672ac34c59da125e3e30f00043c9b88f7..24a7c000594ab646c3e475cc98035a03bdfb9527 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Pager/PagerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Pager/PagerTest.php @@ -14,6 +14,14 @@ * Tests pager functionality. */ class PagerTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('dblog'); + protected $profile = 'testing'; public static function getInfo() { @@ -25,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('dblog')); + parent::setUp(); // Insert 300 log messages. for ($i = 0; $i < 300; $i++) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/SaveTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/SaveTest.php index a34b3848a889cd011c72a7c29a73a828dc5f0361..f017230ce73263daae80aabb07e37f47a7895375 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/SaveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/SaveTest.php @@ -13,6 +13,14 @@ * Tests the path_save() function. */ class SaveTest extends WebTestBase { + + /** + * Enable a helper module that implements hook_path_update(). + * + * @var array + */ + public static $modules = array('path_test'); + public static function getInfo() { return array( 'name' => t('Path save'), @@ -22,8 +30,7 @@ public static function getInfo() { } function setUp() { - // Enable a helper module that implements hook_path_update(). - parent::setUp('path_test'); + parent::setUp(); path_test_reset(); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php index 3e4ab652195dbf072d813acad6192584d50ed562..6bcbca88166ae3812e69f57adbb6f8414fd118dd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php @@ -13,6 +13,14 @@ * Tests hook_url_alter functions. */ class UrlAlterFunctionalTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('path', 'forum', 'url_alter_test'); + public static function getInfo() { return array( 'name' => t('URL altering'), @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('path', 'forum', 'url_alter_test'); - } - /** * Test that URL altering works and that it occurs in the correct order. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php index 8fac3ca88f7706c2dbe28417688dea0e1682250b..c8e67034ea70e063e33a3b423d6e1a828ef0325a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php @@ -14,6 +14,13 @@ */ class SessionHttpsTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('session_test'); + public static function getInfo() { return array( 'name' => 'Session https handling', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - public function setUp() { - parent::setUp('session_test'); - } - protected function testHttpsSession() { global $is_https; diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php index 02cb8ae68659759274737d2975d8d677b9a4add7..1a523e46e830bd07b0cb1949c96deca5378314be 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class SessionTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('session_test'); + public static function getInfo() { return array( 'name' => 'Session tests', @@ -18,10 +26,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('session_test'); - } - /** * Tests for drupal_save_session() and drupal_session_regenerate(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php index f278f60aa4438da851d397ae4c1223e72aedcc77..135f69acd7e1b7a24d5e826ea952d2707b5670ad 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php @@ -13,6 +13,14 @@ * Tests custom access denied functionality. */ class AccessDeniedTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + protected $admin_user; public static function getInfo() { @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Create an administrative user. $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'administer blocks')); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php index 4e8d49aa653480174d0c5f51acb6323599ae8df4..d87eb443bf8b5a884d585f73f1e84a6d954c33f1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php @@ -13,6 +13,14 @@ * Tests administrative overview pages. */ class AdminTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('locale'); + public static function getInfo() { return array( 'name' => 'Administrative pages', @@ -23,7 +31,7 @@ public static function getInfo() { function setUp() { // testAdminPages() requires Locale module. - parent::setUp(array('locale')); + parent::setUp(); // Create an administrator with all permissions, as well as a regular user // who can only access administration pages and perform some Locale module diff --git a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php index 3ac2772d444d1ccab6b1f38cde3d9507f8084352..e13d5782dc94940f379faddc53d31e71f267176a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class CronRunTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('common_test', 'common_test_cron_helper'); + public static function getInfo() { return array( 'name' => 'Cron run', @@ -18,10 +26,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('common_test', 'common_test_cron_helper')); - } - /** * Test cron runs. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php index 5f86c6ea75c12844e5b6b96ab145eac0d697def7..2054180abe82f5f04f7a1054f9ebd61ac190c172 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php @@ -14,6 +14,13 @@ */ class DateFormatsLanguageTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'language'); + public static function getInfo() { return array( 'name' => 'Localize date formats', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'language')); + parent::setUp(); // Create Article node type. $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php index 84bd7c630a5faaaed7cac8dcead30ad7471167db..f50917b49585293eab4c0615380b61d31921f0a7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php @@ -13,6 +13,14 @@ * Tests generic date and time handling capabilities of Drupal. */ class DateTimeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('language'); + public static function getInfo() { return array( 'name' => 'Date and time', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('language')); + parent::setUp(); // Create admin user and log in admin user. $this->admin_user = $this->drupalCreateUser(array('administer site configuration')); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php index b225aedf40959ae0924f2c49cc8204483589e22b..44ad3020fed4122807e2a1df4242ce297aebad01 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php @@ -13,6 +13,14 @@ * Tests error and exception handlers. */ class ErrorHandlerTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('error_test'); + public static function getInfo() { return array( 'name' => 'Error handlers', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('error_test'); - } - /** * Test the error handler. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php index 2323a07fa1d8a8661afe48d7cb3f3c2120b3b900..d620cce2c93e71c10de0f88babff54ba51f1c9e1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php @@ -14,6 +14,13 @@ */ class FrontPageTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'system_test'); + public static function getInfo() { return array( 'name' => 'Front page', @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'system_test')); + parent::setUp(); // Create admin user, log in admin user, and create one node. $this->admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration')); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php index 7fd3090c3b723243b8f10586541659b706f530a8..e1fd6f63ce795b71feac9d18ae6e0adbc471547a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php @@ -13,6 +13,14 @@ * Test main content rendering fallback provided by system module. */ class MainContentFallbackTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block', 'system_test'); + protected $admin_user; protected $web_user; @@ -25,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block', 'system_test')); + parent::setUp(); // Create and login admin user. $this->admin_user = $this->drupalCreateUser(array( diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php index 9ee01011d27123c4d7b1506417c4c291a236e538..c0d00c3ac33203aa65e40519310e0e3b83a36b1c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class PageTitleFilteringTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + protected $content_user; protected $saved_title; @@ -28,7 +36,7 @@ public static function getInfo() { * Implement setUp(). */ function setUp() { - parent::setUp(array('node')); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ShutdownFunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ShutdownFunctionsTest.php index b38c2131c58c3c1d742164e36a046d5141a21e1d..d3a160e5ad70f38a157b594f081d1f67ad985519 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ShutdownFunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ShutdownFunctionsTest.php @@ -13,6 +13,14 @@ * Functional tests shutdown functions. */ class ShutdownFunctionsTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test'); + public static function getInfo() { return array( 'name' => 'Shutdown functions', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('system_test'); - } - /** * Test shutdown functions. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php index 7788c67a35fad560397a1a7875ad98ee757823f6..59256607a16126cb1e32f0485e186c5c865c4fdf 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php @@ -13,6 +13,14 @@ * Tests site maintenance functionality. */ class SiteMaintenanceTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + protected $admin_user; public static function getInfo() { @@ -24,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node')); + parent::setUp(); // Configure 'node' as front page. config('system.site')->set('page.front', 'node')->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SystemAuthorizeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SystemAuthorizeTest.php index b006cdbee65526609803fde2bcac0a56a34db868..730886d6a18ee60d1bbf4d22977120c161f5df2a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SystemAuthorizeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SystemAuthorizeTest.php @@ -13,6 +13,14 @@ * Tests authorize.php and related hooks. */ class SystemAuthorizeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('system_test'); + public static function getInfo() { return array( 'name' => 'Authorize API', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('system_test')); + parent::setUp(); variable_set('allow_authorize_operations', TRUE); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index ed43e49aa841d29114cc75cc98350ff57f20505d..f1e0f228665683fbbe2244530b60a939ae570ba4 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -13,6 +13,14 @@ * Tests for the theme interface functionality. */ class ThemeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'block'); + public static function getInfo() { return array( 'name' => 'Theme interface functionality', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'block')); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php index 3a65e999784b15ddf1fad19d1979b87ecb41dc71..d28e19295792c3dc81bf87551d3efc34df92e57c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php @@ -13,6 +13,14 @@ * Tests autocompletion not loading registry. */ class FastTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('theme_test'); + public static function getInfo() { return array( 'name' => 'Theme fast initialization', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('theme_test'); + parent::setUp(); $this->account = $this->drupalCreateUser(array('access user profiles')); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/HookInitTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/HookInitTest.php index 2bba519dc300d80532361f1e05c09166c1dd4761..3863d22f1654ed906b368a7a5fc5c2ae65a6859b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/HookInitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/HookInitTest.php @@ -13,6 +13,14 @@ * Functional test for initialization of the theme system in hook_init(). */ class HookInitTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('theme_test'); + public static function getInfo() { return array( 'name' => 'Theme initialization in hook_init()', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('theme_test'); - } - /** * Test that the theme system can generate output when called by hook_init(). */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTplPhpAttributesTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTplPhpAttributesTest.php index 82dd7c93600ce3e47d5ffc0de3e1fe7d9981ad00..d06b165fb5ab20845c103e9bd0ed5b8ffcdaecaa 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTplPhpAttributesTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/HtmlTplPhpAttributesTest.php @@ -13,6 +13,14 @@ * Functional test for attributes of html.tpl.php. */ class HtmlTplPhpAttributesTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('theme_test'); + public static function getInfo() { return array( 'name' => 'html.tpl.php html and body attributes', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('theme_test'); - } - /** * Tests that modules and themes can alter variables in html.tpl.php. */ diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php index 16abc78529044e3176a4f8f4afdae4b00c1e1513..9f49f2f1f23e7afee41f2b51b522a9c0a0c948f0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php @@ -14,6 +14,14 @@ * Tests for the ThemeRegistry class. */ class RegistryTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('theme_test'); + protected $profile = 'testing'; public static function getInfo() { return array( @@ -22,9 +30,6 @@ public static function getInfo() { 'group' => 'Theme', ); } - function setUp() { - parent::setUp('theme_test'); - } /** * Tests the behavior of the theme registry class. diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php index 4be9dd5b8285a430d21a82efaf6cf9d84eff9e79..29bfee16646c4177f74386e86e7101deaf93b1f1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php @@ -14,6 +14,14 @@ * Tests low-level theme functions. */ class ThemeTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('theme_test'); + public static function getInfo() { return array( 'name' => 'Theme API', @@ -23,7 +31,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('theme_test'); + parent::setUp(); theme_enable(array('test_theme')); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyHookInvocationTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyHookInvocationTest.php index 8ec1fca6470faa3c9f69157af9e196b3ad36c4fc..7b03fde9079a535e0605cc9a6700e814a555ccc4 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyHookInvocationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyHookInvocationTest.php @@ -13,6 +13,14 @@ * Tests for the invocation of hook_update_dependencies(). */ class DependencyHookInvocationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_test_1', 'update_test_2'); + public static function getInfo() { return array( 'name' => 'Update dependency hook invocation', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('update_test_1', 'update_test_2'); + parent::setUp(); require_once DRUPAL_ROOT . '/core/includes/update.inc'; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyMissingTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyMissingTest.php index e2c94f28a449cc8de0e772068dc7436d88298bb7..0a66324ab720188b4aa252e5cbb0dec76f75bd24 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyMissingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyMissingTest.php @@ -13,6 +13,14 @@ * Tests for missing update dependencies. */ class DependencyMissingTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_test_2'); + public static function getInfo() { return array( 'name' => 'Missing update dependencies', @@ -24,7 +32,7 @@ public static function getInfo() { function setUp() { // Only install update_test_2.module, even though its updates have a // dependency on update_test_3.module. - parent::setUp('update_test_2'); + parent::setUp(); require_once DRUPAL_ROOT . '/core/includes/update.inc'; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyOrderingTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyOrderingTest.php index 099b36b9c19b85f7cb27a205567940372af4fc49..6bd15345251a8eaf5fbd9987869dc2ebe117cdf0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/DependencyOrderingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/DependencyOrderingTest.php @@ -13,6 +13,14 @@ * Tests for the update dependency ordering system. */ class DependencyOrderingTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_test_1', 'update_test_2', 'update_test_3'); + public static function getInfo() { return array( 'name' => 'Update dependency ordering', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('update_test_1', 'update_test_2', 'update_test_3'); + parent::setUp(); require_once DRUPAL_ROOT . '/core/includes/update.inc'; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php index a3b31fbcae1575ddd9b00bba45502f168845a272..1231af4b5aa05c13bd16894de43fa592d5118998 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php @@ -13,6 +13,14 @@ * Tests for the update system functionality. */ class UpdateScriptTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_script_test', 'dblog'); + private $update_url; private $update_user; @@ -25,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('update_script_test', 'dblog')); + parent::setUp(); $this->update_url = $GLOBALS['base_url'] . '/core/update.php'; $this->update_user = $this->drupalCreateUser(array('administer software updates')); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/HooksTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/HooksTest.php index 4a889cb3f5c404f57ff729823496ccdede54455d..3dd43b1519bed96b4f706644d30876153ec54e62 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/HooksTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/HooksTest.php @@ -12,6 +12,13 @@ */ class HooksTest extends TaxonomyTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy_test'); + public static function getInfo() { return array( 'name' => 'Taxonomy term hooks', @@ -21,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('taxonomy_test')); + parent::setUp(); + $taxonomy_admin = $this->drupalCreateUser(array('administer taxonomy')); $this->drupalLogin($taxonomy_admin); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/RssTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/RssTest.php index b44f456d4caa3de445ab083617ffb4b77e56df79..79998b683e1d6ce7e8f426ef05617c289e628e42 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/RssTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/RssTest.php @@ -12,6 +12,13 @@ */ class RssTest extends TaxonomyTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'field_ui'); + public static function getInfo() { return array( 'name' => 'Taxonomy RSS Content.', @@ -21,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('node', 'field_ui')); + parent::setUp(); + $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types')); $this->drupalLogin($this->admin_user); $this->vocabulary = $this->createVocabulary(); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php index 37ec42beaa6fb57aa2920ed3874a0244bd985213..6f4dcb29c6adc3c6f054081a24ef9583481705fe 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php @@ -14,13 +14,15 @@ */ abstract class TaxonomyTestBase extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy'); + function setUp() { - $modules = func_get_args(); - if (isset($modules[0]) && is_array($modules[0])) { - $modules = $modules[0]; - } - $modules[] = 'taxonomy'; - parent::setUp($modules); + parent::setUp(); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php index 90d6cd58202ff4ba10c9891913528a1373780264..c8bd41e829df302480c4e21c6542af3e017ffb28 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php @@ -12,6 +12,13 @@ */ class TermFieldMultipleVocabularyTest extends TaxonomyTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + protected $instance; protected $vocabulary1; protected $vocabulary2; @@ -25,7 +32,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer taxonomy')); $this->drupalLogin($web_user); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php index 4e1a1c41070162b447598724addbab48a1f72a5c..722cc511e5e39b814f6df1e8e14b4d6a2a605fe6 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php @@ -14,6 +14,13 @@ */ class TermFieldTest extends TaxonomyTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + protected $instance; protected $vocabulary; @@ -26,7 +33,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('field_test'); + parent::setUp(); $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer taxonomy')); $this->drupalLogin($web_user); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php index 883ab6e0952d5db599d9ccc4487faed45725aaef..9ac781ac09b4fcabc12479814bfe5521fcb22ee7 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php @@ -12,6 +12,13 @@ */ class VocabularyUnitTest extends TaxonomyTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + public static function getInfo() { return array( 'name' => 'Taxonomy vocabularies', @@ -21,7 +28,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('field_test')); + parent::setUp(); + $admin_user = $this->drupalCreateUser(array('create article content', 'administer taxonomy')); $this->drupalLogin($admin_user); $this->vocabulary = $this->createVocabulary(); diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php index cb74f022640771b9512a5f21419766b8492389a7..3a5efda4a05c27c1af5827d74de09949d01585db 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php @@ -13,6 +13,14 @@ * Tests for private node access on /tracker. */ class TrackerNodeAccessTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node', 'comment', 'tracker', 'node_access_test'); + protected $access_user; protected $no_access_user; @@ -25,7 +33,7 @@ public static function getInfo() { } public function setUp() { - parent::setUp(array('node', 'comment', 'tracker', 'node_access_test')); + parent::setUp(); node_access_rebuild(); variable_set('node_access_test_private', TRUE); } diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php index 168755e32b29ae02007f2387510fcb0b33bc08e4..7cd99cce63f5812093b94b00394d3602f1d96137 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php @@ -14,6 +14,13 @@ */ class TrackerTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment', 'tracker'); + /** * The main user for testing. * @@ -37,7 +44,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('comment', 'tracker'); + parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php index 6b192080f4d7b14311e95ab9edc0c312b8808841..a4091505bceccbad3c51305446da3a9c928eb5c2 100644 --- a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php +++ b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php @@ -14,6 +14,14 @@ * Functional tests for the Translation module. */ class TranslationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('translation', 'translation_test'); + protected $profile = 'standard'; protected $book; @@ -27,7 +35,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('translation', 'translation_test'); + parent::setUp(); // Setup users. $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages', 'translate content')); diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php index 674baf85f040bc595777733a4ec8fba617f17e01..27328c0d0ec3f5eca37bf9c624b4182d85a3c324 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php @@ -12,6 +12,13 @@ */ class UpdateContribTest extends UpdateTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_test', 'update', 'aaa_update_test', 'bbb_update_test', 'ccc_update_test'); + public static function getInfo() { return array( 'name' => 'Update contrib functionality', @@ -21,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('update_test', 'update', 'aaa_update_test', 'bbb_update_test', 'ccc_update_test'); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer site configuration')); $this->drupalLogin($admin_user); } diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php index 6f0336da4a97a37737d0bce9936683e253fe537a..5dc09fd2199058b082f4d675783152e70ee0f4de 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php @@ -12,6 +12,13 @@ */ class UpdateCoreTest extends UpdateTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update_test', 'update'); + public static function getInfo() { return array( 'name' => 'Update core functionality', @@ -21,7 +28,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('update_test', 'update'); + parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer modules')); $this->drupalLogin($admin_user); } diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php index 2a33818846f6c940e155b867038532e62beb2895..1173233313b3738998cd3f1100f0db2dace56562 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php @@ -14,6 +14,13 @@ */ class UpdateCoreUnitTest extends UnitTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update'); + public static function getInfo() { return array( 'name' => "Unit tests", @@ -23,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('update'); + parent::setUp(); module_load_include('inc', 'update', 'update.fetch'); } diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php index 5acbc6eaea632f5ba85aaf31870730fcc8d040db..c7ce8e19208c88db5edeecdd3f7d8aae6a152947 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php @@ -12,6 +12,13 @@ */ class UpdateUploadTest extends UpdateTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('update', 'update_test'); + public static function getInfo() { return array( 'name' => 'Upload and extract module functionality', @@ -21,7 +28,7 @@ public static function getInfo() { } public function setUp() { - parent::setUp('update', 'update_test'); + parent::setUp(); variable_set('allow_authorize_operations', TRUE); $admin_user = $this->drupalCreateUser(array('administer software updates', 'administer site configuration')); $this->drupalLogin($admin_user); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php index c0bed11ec627b0e04fb6ebc8dfc9ede70d0c6087..75890943694463844d565b6ed910d4501cc0616c 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class UserAdminTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('taxonomy'); + public static function getInfo() { return array( 'name' => 'User administration', @@ -18,10 +26,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('taxonomy')); - } - /** * Registers a user and deletes it. */ diff --git a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php index 8e69750a3ac9deef412651f92f700b0a9371917e..a0cee51187d8beff163fa648644e666c8da5933e 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php @@ -13,6 +13,14 @@ * Test user blocks. */ class UserBlocksTests extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('block'); + public static function getInfo() { return array( 'name' => 'User blocks', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('block')); + parent::setUp(); // Enable user login block. db_merge('block') diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php index 4e6a0d50664ead9df7e84c2637b6570a1d9afbb0..ca6c423937e0af17062aa28213c821b59b9533a1 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php @@ -13,6 +13,14 @@ * Test cancelling a user. */ class UserCancelTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment'); + protected $profile = 'standard'; public static function getInfo() { @@ -23,10 +31,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('comment'); - } - /** * Attempt to cancel account without permission. */ diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php index dc85adee2ae73c81efce87526b0ecd8e5110f134..6d74849fe78e28e9635c3930844a8234cb0b1224 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php @@ -13,6 +13,14 @@ * Test user entity callbacks. */ class UserEntityCallbacksTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('user'); + public static function getInfo() { return array( 'name' => 'User entity callback tests', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('user'); + parent::setUp(); $this->account = $this->drupalCreateUser(); $this->anonymous = entity_create('user', (array) drupal_anonymous_user()); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php index dce7d0b0a0f1602c9d7f15d799086dc32e5ee966..b90d26d6562b7a7702c0299396ffda97d016a9dc 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserLanguageCreationTest.php @@ -14,6 +14,13 @@ */ class UserLanguageCreationTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('user', 'language'); + public static function getInfo() { return array( 'name' => 'User language creation', @@ -23,7 +30,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('user', 'language')); + parent::setUp(); + variable_set('user_register', USER_REGISTER_VISITORS); } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php index 41084c3cd24e55c0e9b3f8c1ce2b6b8d6cace9e7..08dc9f558682f90c02ce8eef2c7e34ba2493a4b4 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php @@ -13,6 +13,14 @@ * Functional tests for a user's ability to change their default language. */ class UserLanguageTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('user', 'language'); + public static function getInfo() { return array( 'name' => 'User language settings', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('user', 'language')); - } - /** * Test if user can change their default language. */ diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php index e57cc42d1bffceb898adb2535e917c57974a4b0b..a1ad3a618ebd5fb2288d07847cb075b334025cfb 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class UserPictureTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('image'); + protected $user; protected $_directory_test; @@ -22,7 +30,8 @@ public static function getInfo() { } function setUp() { - parent::setUp(array('image')); + parent::setUp(); + // Enable user pictures. variable_set('user_pictures', 1); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index 56ad9a0bd177f88f8b6467b62439d60ae6a93717..bfa21d0f086bd15c3b0996557ce692de3dee7654 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -10,6 +10,14 @@ use Drupal\simpletest\WebTestBase; class UserRegistrationTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('field_test'); + public static function getInfo() { return array( 'name' => 'User registration', @@ -18,10 +26,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('field_test'); - } - function testRegistrationWithEmailVerification() { // Require e-mail verification. variable_set('user_email_verification', TRUE); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php index 7b427687bd68757058a03bdb457f9f66fc7b539b..74eb5fa43d09e1e313809d38406933dd14a1dd80 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php @@ -13,6 +13,14 @@ * Test user search. */ class UserSearchTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('search'); + public static function getInfo() { return array( 'name' => 'User search', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(array('search')); - } - function testUserSearch() { $user1 = $this->drupalCreateUser(array('access user profiles', 'search content', 'use advanced search')); $this->drupalLogin($user1); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php index 19aa8c957d210662134770569ba69930afca662e..d218b5ff343e9e972620fce076732ed1c2409382 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php @@ -13,6 +13,14 @@ * Test case for user signatures. */ class UserSignatureTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('comment'); + public static function getInfo() { return array( 'name' => 'User signatures', @@ -22,7 +30,7 @@ public static function getInfo() { } function setUp() { - parent::setUp('comment'); + parent::setUp(); // Enable user signatures. variable_set('user_signatures', 1); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php b/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php index 7b553d27a36832fcd25789a4589e6d500a8f83e7..56dbc62f358303d82138c3c06da8c07226fdcc44 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php @@ -14,6 +14,13 @@ */ class UserValidateCurrentPassCustomFormTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('user_form_test'); + public static function getInfo() { return array( 'name' => 'User validate current pass custom form', @@ -33,7 +40,8 @@ public static function getInfo() { protected $adminUser; function setUp() { - parent::setUp('user_form_test'); + parent::setUp(); + // Create two users $this->accessUser = $this->drupalCreateUser(array('access content')); $this->adminUser = $this->drupalCreateUser(array('administer users')); diff --git a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcBasicTest.php b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcBasicTest.php index 7e949857c1ee229b374e6cb9b9b1ca6931cdbb6a..ca606814d476783095516f42f225f88a846a8602 100644 --- a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcBasicTest.php +++ b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcBasicTest.php @@ -14,6 +14,13 @@ */ class XmlRpcBasicTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('xmlrpc'); + public static function getInfo() { return array( 'name' => 'XML-RPC basic', @@ -22,10 +29,6 @@ public static function getInfo() { ); } - public function setUp() { - parent::setUp('xmlrpc'); - } - /** * Ensure that a basic XML-RPC call with no parameters works. */ diff --git a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php index f4823c46366fdd93cf9f8ee6b70e9d2cf3e95cfc..572cd1813672ebc94abe27857d904f3bbea8e0dd 100644 --- a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php +++ b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php @@ -13,6 +13,14 @@ * XML-RPC message and alteration tests. */ class XmlRpcMessagesTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('xmlrpc', 'xmlrpc_test'); + public static function getInfo() { return array( 'name' => 'XML-RPC message and alteration', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('xmlrpc', 'xmlrpc_test'); - } - /** * Make sure that XML-RPC can transfer large messages. */ diff --git a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcValidatorTest.php b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcValidatorTest.php index f48232890e1a6488af1c04f790d094b273d6d72d..b1a9fa8e2f9d7a3186efb9e0e24db0a0826cd57a 100644 --- a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcValidatorTest.php +++ b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcValidatorTest.php @@ -13,6 +13,14 @@ * XML-RPC validator1 specification. */ class XmlRpcValidatorTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('xmlrpc', 'xmlrpc_test'); + public static function getInfo() { return array( 'name' => 'XML-RPC validator', @@ -21,10 +29,6 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp('xmlrpc', 'xmlrpc_test'); - } - /** * Run validator1 tests. */ diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/lib/Drupal/drupal_system_listing_compatible_test/Tests/SystemListingCompatibleTest.php b/profiles/testing/modules/drupal_system_listing_compatible_test/lib/Drupal/drupal_system_listing_compatible_test/Tests/SystemListingCompatibleTest.php index 32b8fc70206112fddac4dee7fdf3b0dbfff20744..95504e3ccad8f7909539c2f872029a0000a76c30 100644 --- a/profiles/testing/modules/drupal_system_listing_compatible_test/lib/Drupal/drupal_system_listing_compatible_test/Tests/SystemListingCompatibleTest.php +++ b/profiles/testing/modules/drupal_system_listing_compatible_test/lib/Drupal/drupal_system_listing_compatible_test/Tests/SystemListingCompatibleTest.php @@ -12,6 +12,17 @@ * Helper to verify tests in installation profile modules. */ class SystemListingCompatibleTest extends WebTestBase { + + /** + * Attempt to enable a module from the Testing profile. + * + * This test uses the Minimal profile, but enables a module from the Testing + * profile to confirm that a different profile can be used for running tests. + * + * @var array + */ + public static $modules = array('drupal_system_listing_compatible_test'); + /** * Use the Minimal profile. * @@ -30,12 +41,6 @@ public static function getInfo() { ); } - function setUp() { - // Attempt to install a module in Testing profile, while this test runs with - // a different profile. - parent::setUp(array('drupal_system_listing_compatible_test')); - } - /** * Non-empty test* method required to executed the test case class. */