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/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/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/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/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/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/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 @@ -