diff --git a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php index a59d294..dde3914 100644 --- a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php +++ b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php @@ -21,7 +21,7 @@ class BulkFormTest extends WebTestBase { * * @var array */ - public static $modules = array('action_bulk_test'); + public static $modules = array('node', 'action_bulk_test'); public static function getInfo() { return array( diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockPageViewTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockPageViewTest.php index 0841fd9..fafb357 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockPageViewTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockPageViewTest.php @@ -13,16 +13,6 @@ class CustomBlockPageViewTest extends CustomBlockTestBase { /** - * Permissions to grant admin user. - * - * @var array - */ - protected $permissions = array( - 'administer blocks', - 'access content' - ); - - /** * Modules to enable. * * @var array diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlTest.php index a6bf316..63579b9 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlTest.php @@ -40,7 +40,7 @@ function setUp() { $this->drupalPlaceBlock('test_html', array('id' => 'test_html_block')); // Enable a menu block, to test more complicated HTML. - $this->drupalPlaceBlock('system_menu_block:tools'); + $this->drupalPlaceBlock('system_menu_block:admin'); } /** diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php index da6202e..0521aa9 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php @@ -19,7 +19,7 @@ class BlockRenderOrderTest extends WebTestBase { * * @var array */ - public static $modules = array('block'); + public static $modules = array('node', 'block'); public static function getInfo() { return array( diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php index 3e738ce..15a389c 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php @@ -23,7 +23,7 @@ class CommentLanguageTest extends WebTestBase { * * @var array */ - public static $modules = array('language', 'language_test', 'comment_test'); + public static $modules = array('node', 'language', 'language_test', 'comment_test'); public static function getInfo() { return array( diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php index 83e34aa..32ffa1f 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php @@ -20,7 +20,7 @@ * * @var array */ - public static $modules = array('comment', 'comment_test_views'); + public static $modules = array('node', 'comment', 'comment_test_views'); /** * Stores a comment used by the tests. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php index 393db33..ed4b1e2 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php @@ -23,7 +23,7 @@ class ConfigTranslationUiTest extends WebTestBase { * * @var array */ - public static $modules = array('contact', 'config_translation', 'config_translation_test', 'views', 'views_ui', 'contextual'); + public static $modules = array('node', 'contact', 'config_translation', 'config_translation_test', 'views', 'views_ui', 'contextual'); /** * Languages to enable. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationViewListUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationViewListUiTest.php index eb45b82..a4982e10 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationViewListUiTest.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationViewListUiTest.php @@ -19,7 +19,7 @@ class ConfigTranslationViewListUiTest extends UITestBase { * * @var array */ - public static $testViews = array('test_view'); + public static $testViews = array('node', 'test_view'); /** * Modules to enable. diff --git a/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml b/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml index 1771823..a42573f 100644 --- a/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml +++ b/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml @@ -11,10 +11,7 @@ display: position: 1 display_options: access: - type: perm - options: - perm: 'access content' - perm: 'access user profiles' + type: none cache: type: none options: { } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php index 4c7327d..1379d11 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php @@ -21,7 +21,7 @@ public static function getInfo() { ); } - public static $modules = array('field_ui', 'entity_reference'); + public static $modules = array('node', 'field_ui', 'entity_reference'); public function setUp() { parent::setUp(); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php index 7e6a652..4c018bb 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php @@ -14,7 +14,7 @@ */ class SelectionTest extends WebTestBase { - public static $modules = array('views', 'entity_reference', 'entity_reference_test', 'entity_test'); + public static $modules = array('node', 'views', 'entity_reference', 'entity_reference_test', 'entity_test'); public static function getInfo() { return array( diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php index 22d0b88..7badfb6 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php @@ -32,7 +32,7 @@ * * @var array */ - public static $modules = array('field_test_views'); + public static $modules = array('node', 'field_test_views'); /** * Stores the field definitions used by the test. diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php index 7a8f3c5..75339a3 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php @@ -20,7 +20,7 @@ * * @var array */ - public static $modules = array('file', 'file_module_test', 'field_ui'); + public static $modules = array('node', 'file', 'file_module_test', 'field_ui'); protected $admin_user; diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php index d9b570f..6596f87 100644 --- a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php @@ -36,7 +36,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - $account = $this->drupalCreateUser(array('access content')); + $account = $this->drupalCreateUser(); $this->drupalLogin($account); $image_files = $this->drupalGetTestFiles('image'); diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php index cbf1661..e402fda 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php @@ -13,6 +13,14 @@ * Tests the filter format access functionality in the Filter module. */ class FilterFormatAccessTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('filter', 'node'); + /** * A user with administrative permissions. * diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php index d5a3c02..5b413f8 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php @@ -20,7 +20,7 @@ class LanguageConfigurationElementTest extends WebTestBase { * * @var array */ - public static $modules = array('language', 'language_elements_test'); + public static $modules = array('node', 'language', 'language_elements_test'); public static function getInfo() { return array( diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php index 1c2c597..093da50 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php @@ -19,7 +19,7 @@ class LocaleContentTest extends WebTestBase { * * @var array */ - public static $modules = array('locale'); + public static $modules = array('node', 'locale'); public static function getInfo() { return array( diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index 48f9361..b2e7d78 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -17,7 +17,7 @@ class MenuTest extends MenuWebTestBase { * * @var array */ - public static $modules = array('block', 'contextual', 'help', 'path', 'test_page_test'); + public static $modules = array('node', 'block', 'contextual', 'help', 'path', 'test_page_test'); /** * A user with administration rights. diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php index a44b229..d24ed35 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateNodeConfigsTest.php @@ -14,6 +14,13 @@ class MigrateNodeConfigsTest extends MigrateDrupalTestBase { /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + + /** * {@inheritdoc} */ public static function getInfo() { diff --git a/core/modules/node/node.install b/core/modules/node/node.install index ba15fa3..eaa022c 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -423,6 +423,18 @@ function node_schema() { * Implements hook_install(). */ function node_install() { + // Enable default permissions for system roles. + // IMPORTANT: Modules SHOULD NOT automatically grant any user role access + // permissions in hook_install(). + // However, the 'access content' permission is a very special case, since + // there is hardly a point in installing the Node module without granting + // these permissions. Doing so also allows tests to continue to operate as + // expected without first having to manually grant these default permissions. + if (\Drupal::moduleHandler()->moduleExists('user')) { + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content')); + } + // Populate the node access table. db_insert('node_access') ->fields(array( diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php index 8793db2..f7a922c 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php @@ -19,7 +19,7 @@ class OptionsFieldUITest extends FieldTestBase { * * @var array */ - public static $modules = array('options', 'field_test', 'taxonomy', 'field_ui'); + public static $modules = array('node', 'options', 'field_test', 'taxonomy', 'field_ui'); /** * The name of the created content type. diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php index 02304b6..57d3e14 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php @@ -19,7 +19,7 @@ class OptionsWidgetsTest extends FieldTestBase { * * @var array */ - public static $modules = array('options', 'entity_test', 'options_test', 'taxonomy', 'field_ui'); + public static $modules = array('node', 'options', 'entity_test', 'options_test', 'taxonomy', 'field_ui'); /** * A field with cardinality 1 to use in this test class. diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php index 073490d..7d2a099 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php @@ -19,7 +19,7 @@ class UserAttributesTest extends WebTestBase { * * @var array */ - public static $modules = array('rdf'); + public static $modules = array('rdf', 'node'); public static function getInfo() { return array( diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php index 021e1f9..5f3ed46 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php @@ -43,6 +43,13 @@ */ protected $defaultAuth; + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('rest', 'entity_test', 'node'); + protected function setUp() { parent::setUp(); $this->defaultFormat = 'hal_json'; diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php index 58b0313..9dc04dc 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php @@ -20,7 +20,7 @@ * * @var array */ - public static $modules = array('toolbar', 'shortcut'); + public static $modules = array('node', 'toolbar', 'shortcut'); /** * User with permission to administer shortcuts. diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php index 2a19a5c1..25853ad 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php @@ -144,7 +144,7 @@ function testUserAgentValidation() { function testWebTestRunner() { $this->pass = t('SimpleTest pass.'); $this->fail = t('SimpleTest fail.'); - $this->valid_permission = 'access content'; + $this->valid_permission = 'access administration pages'; $this->invalid_permission = 'invalid permission'; if ($this->inCURL()) { diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php index 8443155..ec85e46 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php @@ -22,7 +22,7 @@ class StatisticsLoggingTest extends WebTestBase { * * @var array */ - public static $modules = array('statistics', 'block'); + public static $modules = array('node', 'statistics', 'block'); /** * The Guzzle HTTP client. diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php index fd447d1..7d3e567 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php @@ -23,7 +23,7 @@ class IntegrationTest extends ViewTestBase { * * @var array */ - public static $modules = array('statistics', 'statistics_test_views'); + public static $modules = array('statistics', 'statistics_test_views', 'node'); /** * Stores the user object that accesses the page. 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 24a572a..588da09 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxTestBase.php @@ -19,7 +19,7 @@ * * @var array */ - public static $modules = array('ajax_test', 'ajax_forms_test'); + public static $modules = array('node', 'ajax_test', 'ajax_forms_test'); /** * Asserts the array of Ajax commands contains the searched command. 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 ee4fe4d..ffe5fdb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/WriteRecordTest.php @@ -19,7 +19,7 @@ class WriteRecordTest extends WebTestBase { * * @var array */ - public static $modules = array('database_test'); + public static $modules = array('database_test', 'node'); public static function getInfo() { return array( diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php index 9fd5a34..5bc1e79 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTestBase.php @@ -20,7 +20,7 @@ * * @var array */ - public static $modules = array('taxonomy'); + public static $modules = array('node', 'taxonomy'); function setUp() { parent::setUp(); diff --git a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php index 7fec4ac..3ca1039 100644 --- a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php @@ -53,7 +53,7 @@ class ToolbarAdminMenuTest extends WebTestBase { * * @var array */ - public static $modules = array('block', 'menu', 'user', 'taxonomy', 'toolbar', 'language', 'test_page_test', 'locale'); + public static $modules = array('node', 'block', 'menu', 'user', 'taxonomy', 'toolbar', 'language', 'test_page_test', 'locale'); public static function getInfo() { return array( diff --git a/core/modules/tracker/tracker.info.yml b/core/modules/tracker/tracker.info.yml index e3fb4b7..be8d61b 100644 --- a/core/modules/tracker/tracker.info.yml +++ b/core/modules/tracker/tracker.info.yml @@ -2,6 +2,7 @@ name: Tracker type: module description: 'Enables tracking of recent content for users.' dependencies: + - node - comment package: Core version: VERSION diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php index c9d893d..cc8f652 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php @@ -14,6 +14,13 @@ */ class UserCancelTest extends WebTestBase { + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + public static function getInfo() { return array( 'name' => 'Cancel account', diff --git a/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php index 5626096..92746c8 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php @@ -27,9 +27,9 @@ public static function getInfo() { */ function testUserDeleteMultiple() { // Create a few users with permissions, so roles will be created. - $user_a = $this->drupalCreateUser(array('access content')); - $user_b = $this->drupalCreateUser(array('access content')); - $user_c = $this->drupalCreateUser(array('access content')); + $user_a = $this->drupalCreateUser(array('access user profiles')); + $user_b = $this->drupalCreateUser(array('access user profiles')); + $user_c = $this->drupalCreateUser(array('access user profiles')); $uids = array($user_a->id(), $user_b->id(), $user_c->id()); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php index fac4a54..78c8d6d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php @@ -46,14 +46,14 @@ function testUserPermissionChanges() { $this->assertIdentical($previous_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); // Add a permission. - $this->assertFalse($account->hasPermission('administer nodes'), 'User does not have "administer nodes" permission.'); + $this->assertFalse($account->hasPermission('administer users'), 'User does not have "administer users" permission.'); $edit = array(); - $edit[$rid . '[administer nodes]'] = TRUE; + $edit[$rid . '[administer users]'] = TRUE; $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.'); $storage_controller = $this->container->get('entity.manager')->getStorageController('user_role'); $storage_controller->resetCache(); - $this->assertTrue($account->hasPermission('administer nodes'), 'User now has "administer nodes" permission.'); + $this->assertTrue($account->hasPermission('administer users'), 'User now has "administer users" permission.'); $current_permissions_hash = $permissions_hash_generator->generate($account); $this->assertIdentical($current_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); $this->assertNotEqual($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); @@ -105,19 +105,19 @@ function testUserRoleChangePermissions() { $previous_permissions_hash = $permissions_hash_generator->generate($account); // Verify current permissions. - $this->assertFalse($account->hasPermission('administer nodes'), 'User does not have "administer nodes" permission.'); + $this->assertFalse($account->hasPermission('administer users'), 'User does not have "administer users" permission.'); $this->assertTrue($account->hasPermission('access user profiles'), 'User has "access user profiles" permission.'); $this->assertTrue($account->hasPermission('administer site configuration'), 'User has "administer site configuration" permission.'); // Change permissions. $permissions = array( - 'administer nodes' => 1, + 'administer users' => 1, 'access user profiles' => 0, ); user_role_change_permissions($rid, $permissions); // Verify proper permission changes. - $this->assertTrue($account->hasPermission('administer nodes'), 'User now has "administer nodes" permission.'); + $this->assertTrue($account->hasPermission('administer users'), 'User now has "administer users" permission.'); $this->assertFalse($account->hasPermission('access user profiles'), 'User no longer has "access user profiles" permission.'); $this->assertTrue($account->hasPermission('administer site configuration'), 'User still has "administer site configuration" permission.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php index b9cd7f8..99133ea 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php @@ -34,7 +34,7 @@ function setUp() { * again. */ function testAssignAndRemoveRole() { - $rid = $this->drupalCreateRole(array('administer content types')); + $rid = $this->drupalCreateRole(array('administer users')); $account = $this->drupalCreateUser(); // Assign the role to the user. @@ -55,7 +55,7 @@ function testAssignAndRemoveRole() { * be removed again. */ function testCreateUserWithRole() { - $rid = $this->drupalCreateRole(array('administer content types')); + $rid = $this->drupalCreateRole(array('administer users')); // Create a new user and add the role at the same time. $edit = array( 'name' => $this->randomName(), diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php index 25fd8d9..74a1712 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php @@ -19,7 +19,7 @@ class UserSignatureTest extends WebTestBase { * * @var array */ - public static $modules = array('comment'); + public static $modules = array('node', 'comment'); public static function getInfo() { return array( diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php index 956a257..0702799 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php @@ -13,6 +13,14 @@ * Tests for user-configurable time zones. */ class UserTimeZoneTest extends WebTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = array('node'); + public static function getInfo() { return array( 'name' => 'User time zones', diff --git a/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php b/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php index 43b6856..c533766 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserValidateCurrentPassCustomFormTest.php @@ -43,7 +43,7 @@ function setUp() { parent::setUp(); // Create two users - $this->accessUser = $this->drupalCreateUser(array('access content')); + $this->accessUser = $this->drupalCreateUser(array()); $this->adminUser = $this->drupalCreateUser(array('administer users')); } diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php index 0b4df3d..51017dc 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php @@ -20,7 +20,7 @@ * * @var array */ - public static $modules = array('user_test_views'); + public static $modules = array('user_test_views', 'node'); /** * Users to use during this test. diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/UITestBase.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/UITestBase.php index d064490..4eee5d8 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/UITestBase.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/UITestBase.php @@ -33,7 +33,7 @@ * * @var array */ - public static $modules = array('views_ui', 'block'); + public static $modules = array('node', 'views_ui', 'block'); protected function setUp() { parent::setUp(); diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install index 6f08fe7..52bea38 100644 --- a/core/profiles/minimal/minimal.install +++ b/core/profiles/minimal/minimal.install @@ -17,8 +17,4 @@ function minimal_install() { // Allow visitor account creation, but with administrative approval. \Drupal::config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(); - - // Enable default permissions for system roles. - user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content')); - user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content')); } diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index 8718567..bcb1d5c 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -32,8 +32,8 @@ function standard_install() { $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(); // Enable default permissions for system roles. - user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access comments')); - user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'skip comment approval')); + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access comments', 'post comments', 'skip comment approval')); // Enable all permissions for the administrator role. user_role_grant_permissions('administrator', array_keys(\Drupal::moduleHandler()->invokeAll('permission'))); diff --git a/core/profiles/testing/testing.info.yml b/core/profiles/testing/testing.info.yml index d1076e6..b905706 100644 --- a/core/profiles/testing/testing.info.yml +++ b/core/profiles/testing/testing.info.yml @@ -4,5 +4,3 @@ description: 'Minimal profile for running tests. Includes absolutely required mo version: VERSION core: 8.x hidden: true -dependencies: - - node diff --git a/core/profiles/testing/testing.install b/core/profiles/testing/testing.install deleted file mode 100644 index 7575d22..0000000 --- a/core/profiles/testing/testing.install +++ /dev/null @@ -1,19 +0,0 @@ -