Issue #1541298 by sun, Berdir: Remove Node module dependency from Testing profile.
parent
9d5d0eab42
commit
cdab74eed5
|
@ -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(
|
||||
|
|
|
@ -12,16 +12,6 @@ namespace Drupal\custom_block\Tests;
|
|||
*/
|
||||
class CustomBlockPageViewTest extends CustomBlockTestBase {
|
||||
|
||||
/**
|
||||
* Permissions to grant admin user.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $permissions = array(
|
||||
'administer blocks',
|
||||
'access content'
|
||||
);
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
|
|
|
@ -40,7 +40,7 @@ class BlockHtmlTest extends WebTestBase {
|
|||
$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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -24,7 +24,7 @@ class DisplayBlockTest extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('block_test_views', 'test_page_test', 'contextual', 'views_ui');
|
||||
public static $modules = array('node', 'block_test_views', 'test_page_test', 'contextual', 'views_ui');
|
||||
|
||||
/**
|
||||
* Views used by this test.
|
||||
|
|
|
@ -369,10 +369,9 @@ class Comment extends ContentEntityBase implements CommentInterface {
|
|||
->setDescription(t('The parent comment ID if this is a reply to a comment.'))
|
||||
->setSetting('target_type', 'comment');
|
||||
|
||||
$fields['entity_id'] = FieldDefinition::create('entity_reference')
|
||||
$fields['entity_id'] = FieldDefinition::create('integer')
|
||||
->setLabel(t('Entity ID'))
|
||||
->setDescription(t('The ID of the entity of which this comment is a reply.'))
|
||||
->setSetting('target_type', 'node')
|
||||
->setRequired(TRUE);
|
||||
|
||||
$fields['langcode'] = FieldDefinition::create('language')
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class CommentTestBase extends ViewTestBase {
|
|||
*
|
||||
* @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.
|
||||
|
|
|
@ -18,7 +18,7 @@ class DefaultViewRecentComments extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('comment', 'block');
|
||||
public static $modules = array('node', 'comment', 'block');
|
||||
|
||||
/**
|
||||
* Number of results for the Master display.
|
||||
|
|
|
@ -21,7 +21,7 @@ class WizardTest extends WizardTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('comment');
|
||||
public static $modules = array('node', 'comment');
|
||||
|
||||
|
||||
public static function getInfo() {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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: { }
|
||||
|
|
|
@ -21,7 +21,7 @@ class EntityReferenceAdminTest extends WebTestBase {
|
|||
);
|
||||
}
|
||||
|
||||
public static $modules = array('field_ui', 'entity_reference');
|
||||
public static $modules = array('node', 'field_ui', 'entity_reference');
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\simpletest\WebTestBase;
|
|||
*/
|
||||
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(
|
||||
|
|
|
@ -32,7 +32,7 @@ abstract class FieldTestBase extends ViewTestBase {
|
|||
*
|
||||
* @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.
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class FileFieldTestBase extends WebTestBase {
|
|||
*
|
||||
* @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;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class SaveUploadTest extends FileManagedTestBase {
|
|||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
$account = $this->drupalCreateUser(array('access content'));
|
||||
$account = $this->drupalCreateUser();
|
||||
$this->drupalLogin($account);
|
||||
|
||||
$image_files = $this->drupalGetTestFiles('image');
|
||||
|
|
|
@ -13,6 +13,14 @@ use Drupal\simpletest\WebTestBase;
|
|||
* 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.
|
||||
*
|
||||
|
|
|
@ -22,7 +22,7 @@ class FileDenormalizeTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('hal', 'file');
|
||||
public static $modules = array('hal', 'file', 'node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -13,6 +13,13 @@ use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
|
|||
|
||||
class MigrateNodeConfigsTest extends MigrateDrupalTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -43,6 +43,13 @@ abstract class RESTTestBase extends WebTestBase {
|
|||
*/
|
||||
protected $defaultAuth;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('rest', 'entity_test', 'node');
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->defaultFormat = 'hal_json';
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class ShortcutTestBase extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('toolbar', 'shortcut');
|
||||
public static $modules = array('node', 'toolbar', 'shortcut');
|
||||
|
||||
/**
|
||||
* User with permission to administer shortcuts.
|
||||
|
|
|
@ -146,7 +146,7 @@ class SimpleTestTest extends WebTestBase {
|
|||
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->isInChildSite()) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -19,7 +19,7 @@ abstract class AjaxTestBase extends WebTestBase {
|
|||
*
|
||||
* @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.
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -34,9 +34,6 @@ class EntityRevisionsTest extends WebTestBase {
|
|||
|
||||
// Create and login user.
|
||||
$this->web_user = $this->drupalCreateUser(array(
|
||||
'view all revisions',
|
||||
'revert all revisions',
|
||||
'delete all revisions',
|
||||
'administer entity_test content',
|
||||
));
|
||||
$this->drupalLogin($this->web_user);
|
||||
|
|
|
@ -22,7 +22,7 @@ class RebuildTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('form_test');
|
||||
public static $modules = array('node', 'form_test');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -38,7 +38,7 @@ class StorageTest extends WebTestBase {
|
|||
function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->web_user = $this->drupalCreateUser(array('access content'));
|
||||
$this->web_user = $this->drupalCreateUser();
|
||||
$this->drupalLogin($this->web_user);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ class MenuRouterTest extends WebTestBase {
|
|||
* Tests for menu_link_maintain().
|
||||
*/
|
||||
protected function doTestMenuLinkMaintain() {
|
||||
$admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration'));
|
||||
$admin_user = $this->drupalCreateUser(array('administer site configuration'));
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
// Create three menu items.
|
||||
|
|
|
@ -121,12 +121,13 @@ class DependencyTest extends ModuleTestBase {
|
|||
$this->assertModules(array('module_test'), TRUE);
|
||||
\Drupal::state()->set('module_test.dependency', 'dependency');
|
||||
// module_test creates a dependency chain:
|
||||
// - forum depends on taxonomy, comment, datetime, history, and ban (via module_test)
|
||||
// - forum depends on node, taxonomy, comment, datetime, history, and
|
||||
// ban (via module_test)
|
||||
// - taxonomy depends on options
|
||||
// - options depends on number
|
||||
// - ban depends on xmlrpc (via module_test)
|
||||
// The correct enable order is:
|
||||
$expected_order = array('xmlrpc', 'ban', 'datetime', 'comment', 'history', 'number', 'options', 'taxonomy', 'forum');
|
||||
$expected_order = array('xmlrpc', 'ban', 'node', 'datetime', 'comment', 'history', 'number', 'options', 'taxonomy', 'forum');
|
||||
|
||||
// Enable the modules through the UI, verifying that the dependency chain
|
||||
// is correct.
|
||||
|
@ -134,7 +135,8 @@ class DependencyTest extends ModuleTestBase {
|
|||
$edit['modules[Core][forum][enable]'] = 'forum';
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
|
||||
$this->assertModules(array('forum'), FALSE);
|
||||
$this->assertText(t('You must enable the History, Taxonomy, Options, Number, Comment, Datetime, Ban, XML-RPC modules to install Forum.'));
|
||||
$this->assertText(t('You must enable the Node, History, Taxonomy, Options, Number, Comment, Datetime, Ban, XML-RPC modules to install Forum.'));
|
||||
$edit['modules[Core][node][enable]'] = 'node';
|
||||
$edit['modules[Core][history][enable]'] = 'history';
|
||||
$edit['modules[Field types][options][enable]'] = 'options';
|
||||
$edit['modules[Field types][number][enable]'] = 'number';
|
||||
|
@ -144,7 +146,7 @@ class DependencyTest extends ModuleTestBase {
|
|||
$edit['modules[Core][ban][enable]'] = 'ban';
|
||||
$edit['modules[Core][xmlrpc][enable]'] = 'xmlrpc';
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
|
||||
$this->assertModules(array('forum', 'ban', 'xmlrpc', 'datetime', 'comment', 'history', 'taxonomy', 'options', 'number'), TRUE);
|
||||
$this->assertModules(array('forum', 'ban', 'node', 'xmlrpc', 'datetime', 'comment', 'history', 'taxonomy', 'options', 'number'), TRUE);
|
||||
|
||||
// Check the actual order which is saved by module_test_modules_enabled().
|
||||
$module_order = \Drupal::state()->get('module_test.install_order') ?: array();
|
||||
|
|
|
@ -28,7 +28,7 @@ class UpcastingTest extends WebTestBase {
|
|||
);
|
||||
}
|
||||
|
||||
public static $modules = array('paramconverter_test');
|
||||
public static $modules = array('paramconverter_test', 'node');
|
||||
|
||||
/**
|
||||
* Confirms that all parameters are converted as expected.
|
||||
|
|
|
@ -39,7 +39,7 @@ class SessionTest extends WebTestBase {
|
|||
$this->assertTrue(drupal_save_session(), 'drupal_save_session() correctly returns TRUE when saving has been enabled.', 'Session');
|
||||
|
||||
// Test session hardening code from SA-2008-044.
|
||||
$user = $this->drupalCreateUser(array('access content'));
|
||||
$user = $this->drupalCreateUser();
|
||||
|
||||
// Enable sessions.
|
||||
$this->sessionReset($user->id());
|
||||
|
@ -81,7 +81,7 @@ class SessionTest extends WebTestBase {
|
|||
* Test data persistence via the session_test module callbacks.
|
||||
*/
|
||||
function testDataPersistence() {
|
||||
$user = $this->drupalCreateUser(array('access content'));
|
||||
$user = $this->drupalCreateUser(array());
|
||||
// Enable sessions.
|
||||
$this->sessionReset($user->id());
|
||||
|
||||
|
@ -133,7 +133,7 @@ class SessionTest extends WebTestBase {
|
|||
$this->assertNoText($value_1, 'Session has persisted for an authenticated user after logging out and then back in.', 'Session');
|
||||
|
||||
// Change session and create another user.
|
||||
$user2 = $this->drupalCreateUser(array('access content'));
|
||||
$user2 = $this->drupalCreateUser(array());
|
||||
$this->sessionReset($user2->id());
|
||||
$this->drupalLogin($user2);
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ class SessionTest extends WebTestBase {
|
|||
* Test that sessions are only saved when necessary.
|
||||
*/
|
||||
function testSessionWrite() {
|
||||
$user = $this->drupalCreateUser(array('access content'));
|
||||
$user = $this->drupalCreateUser(array());
|
||||
$this->drupalLogin($user);
|
||||
|
||||
$sql = 'SELECT u.access, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE u.uid = :uid';
|
||||
|
@ -246,7 +246,7 @@ class SessionTest extends WebTestBase {
|
|||
* Test that empty session IDs are not allowed.
|
||||
*/
|
||||
function testEmptySessionID() {
|
||||
$user = $this->drupalCreateUser(array('access content'));
|
||||
$user = $this->drupalCreateUser(array());
|
||||
$this->drupalLogin($user);
|
||||
$this->drupalGet('session-test/is-logged-in');
|
||||
$this->assertResponse(200, 'User is logged in.');
|
||||
|
|
|
@ -20,7 +20,7 @@ class DateTimeTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('language');
|
||||
public static $modules = array('node', 'language');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -20,7 +20,7 @@ class ThemeTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('theme_test');
|
||||
public static $modules = array('theme_test', 'node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -19,7 +19,7 @@ class TwigDebugMarkupTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('theme_test');
|
||||
public static $modules = array('theme_test', 'node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -5,6 +5,7 @@ package: Core
|
|||
version: VERSION
|
||||
core: 8.x
|
||||
dependencies:
|
||||
- node
|
||||
- options
|
||||
- text
|
||||
configure: taxonomy.vocabulary_list
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -2,6 +2,7 @@ name: Tracker
|
|||
type: module
|
||||
description: 'Enables tracking of recent content for users.'
|
||||
dependencies:
|
||||
- node
|
||||
- comment
|
||||
package: Core
|
||||
version: VERSION
|
||||
|
|
|
@ -207,7 +207,7 @@ function tracker_comment_update(CommentInterface $comment) {
|
|||
// $comment->save() calls hook_comment_publish() for all published comments
|
||||
// so we need to handle all other values here.
|
||||
if ($comment->status->value != CommentInterface::PUBLISHED && $comment->entity_type->value == 'node') {
|
||||
_tracker_remove($comment->entity_id->target_id, $comment->getOwnerId(), $comment->changed->value);
|
||||
_tracker_remove($comment->entity_id->value, $comment->getOwnerId(), $comment->changed->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ function tracker_comment_update(CommentInterface $comment) {
|
|||
*/
|
||||
function tracker_comment_publish(CommentInterface $comment) {
|
||||
if ($comment->entity_type->value == 'node') {
|
||||
_tracker_add($comment->entity_id->target_id, $comment->getOwnerId(), $comment->changed->value);
|
||||
_tracker_add($comment->entity_id->value, $comment->getOwnerId(), $comment->changed->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ function tracker_comment_publish(CommentInterface $comment) {
|
|||
*/
|
||||
function tracker_comment_unpublish(CommentInterface $comment) {
|
||||
if ($comment->entity_type->value == 'node') {
|
||||
_tracker_remove($comment->entity_id->target_id, $comment->getOwnerId(), $comment->changed->value);
|
||||
_tracker_remove($comment->entity_id->value, $comment->getOwnerId(), $comment->changed->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ function tracker_comment_unpublish(CommentInterface $comment) {
|
|||
*/
|
||||
function tracker_comment_delete(CommentInterface $comment) {
|
||||
if ($comment->entity_type->value == 'node') {
|
||||
_tracker_remove($comment->entity_id->target_id, $comment->getOwnerId(), $comment->changed->value);
|
||||
_tracker_remove($comment->entity_id->value, $comment->getOwnerId(), $comment->changed->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,13 @@ use Drupal\simpletest\WebTestBase;
|
|||
*/
|
||||
class UserCancelTest extends WebTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Cancel account',
|
||||
|
|
|
@ -27,9 +27,9 @@ class UserDeleteTest extends WebTestBase {
|
|||
*/
|
||||
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());
|
||||
|
||||
|
|
|
@ -46,14 +46,14 @@ class UserPermissionsTest extends WebTestBase {
|
|||
$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 @@ class UserPermissionsTest extends WebTestBase {
|
|||
$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.');
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class UserRolesAssignmentTest extends WebTestBase {
|
|||
* 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 @@ class UserRolesAssignmentTest extends WebTestBase {
|
|||
* 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(),
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -13,6 +13,14 @@ use Drupal\simpletest\WebTestBase;
|
|||
* 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',
|
||||
|
|
|
@ -43,7 +43,7 @@ class UserValidateCurrentPassCustomFormTest extends WebTestBase {
|
|||
parent::setUp();
|
||||
|
||||
// Create two users
|
||||
$this->accessUser = $this->drupalCreateUser(array('access content'));
|
||||
$this->accessUser = $this->drupalCreateUser(array());
|
||||
$this->adminUser = $this->drupalCreateUser(array('administer users'));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class UserTestBase extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('user_test_views');
|
||||
public static $modules = array('user_test_views', 'node');
|
||||
|
||||
/**
|
||||
* Users to use during this test.
|
||||
|
|
|
@ -26,7 +26,7 @@ class FieldEntityTest extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('comment');
|
||||
public static $modules = array('node', 'comment');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -21,6 +21,13 @@ class AreaHTTPStatusCodeTest extends HandlerTestBase {
|
|||
*/
|
||||
public static $testViews = array('test_http_status_code');
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Area: HTTP Status Code',
|
||||
|
|
|
@ -27,7 +27,7 @@ class AreaTest extends HandlerTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui');
|
||||
public static $modules = array('node', 'views_ui');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -19,6 +19,13 @@ class ArgumentStringTest extends HandlerTestBase {
|
|||
*/
|
||||
public static $testViews = array('test_glossary');
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Argument: String',
|
||||
|
|
|
@ -23,6 +23,13 @@ class FieldDropButtonTest extends HandlerTestBase {
|
|||
*/
|
||||
public static $testViews = array('test_dropbutton');
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Field: Dropbutton',
|
||||
|
|
|
@ -24,7 +24,7 @@ class FilterDateTest extends HandlerTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui');
|
||||
public static $modules = array('node', 'views_ui');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -24,6 +24,13 @@ class AccessTest extends PluginTestBase {
|
|||
*/
|
||||
public static $testViews = array('test_access_none', 'test_access_static', 'test_access_dynamic');
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Access',
|
||||
|
|
|
@ -27,7 +27,7 @@ class ArgumentDefaultTest extends PluginTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui');
|
||||
public static $modules = array('node', 'views_ui');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -26,7 +26,7 @@ class DisplayFeedTest extends PluginTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui');
|
||||
public static $modules = array('node', 'views_ui');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -28,7 +28,7 @@ class ExposedFormTest extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui', 'block');
|
||||
public static $modules = array('node', 'views_ui', 'block');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -21,6 +21,13 @@ class MiniPagerTest extends PluginTestBase {
|
|||
*/
|
||||
public static $testViews = array('test_mini_pager');
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node');
|
||||
|
||||
/**
|
||||
* Nodes used by the test.
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ class PagerTest extends PluginTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui');
|
||||
public static $modules = array('node', 'views_ui');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -43,7 +43,7 @@ class ViewsTaxonomyAutocompleteTest extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('taxonomy');
|
||||
public static $modules = array('node', 'taxonomy');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -19,7 +19,7 @@ abstract class WizardTestBase extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui', 'block');
|
||||
public static $modules = array('node', 'views_ui', 'block');
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
|
|
|
@ -11,7 +11,7 @@ display:
|
|||
position: null
|
||||
display_options:
|
||||
access:
|
||||
type: perm
|
||||
type: none
|
||||
cache:
|
||||
type: none
|
||||
query:
|
||||
|
|
|
@ -33,7 +33,7 @@ abstract class UITestBase extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views_ui', 'block');
|
||||
public static $modules = array('node', 'views_ui', 'block');
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
@ -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')));
|
||||
|
|
|
@ -4,5 +4,3 @@ description: 'Minimal profile for running tests. Includes absolutely required mo
|
|||
version: VERSION
|
||||
core: 8.x
|
||||
hidden: true
|
||||
dependencies:
|
||||
- node
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Install, update and uninstall functions for the testing profile.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_install().
|
||||
*
|
||||
* Perform actions to set up the site for this profile.
|
||||
*
|
||||
* @see system_install()
|
||||
*/
|
||||
function testing_install() {
|
||||
// Enable default permissions for system roles.
|
||||
// @todo Remove dependency on Node module.
|
||||
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
|
||||
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
|
||||
}
|
Loading…
Reference in New Issue