protected function setUp() { parent::setUp(); $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content', 'post comments')); $this->drupalLogin($this->admin_user); $this->container->get('comment.manager')->addDefaultField('node', 'page'); }
protected function setUp() { parent::setUp(); $this->webUser = $this->drupalCreateUser(array('edit own page content', 'create page content')); $this->adminUser = $this->drupalCreateUser(array('bypass node access', 'administer nodes')); $this->drupalPlaceBlock('local_tasks_block'); }
function setUp() { parent::setUp(); // Create users and test node. $this->adminUser = $this->drupalCreateUser(array('administer content types', 'administer nodes', 'administer blocks')); $this->webUser = $this->drupalCreateUser(array('access content', 'create article content')); }
function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports')); $this->drupalLogin($web_user); $this->web_user = $web_user; }
protected function setUp() { parent::setUp(); node_access_test_add_field(entity_load('node_type', 'article')); node_access_rebuild(); \Drupal::state()->set('node_access_test.private', TRUE); }
/** * {@inheritdoc} */ function setUp() { parent::setUp(); // Create and log in user. $web_user = $this->drupalCreateUser(array('administer nodes', 'edit any page content')); $this->drupalLogin($web_user); }
protected function setUp() { parent::setUp(); // Create and log in user. $web_user = $this->drupalCreateUser(array('view page revisions', 'revert page revisions', 'delete page revisions', 'edit any page content', 'delete any page content')); $this->drupalLogin($web_user); // Create initial node. $node = $this->drupalCreateNode(); $settings = get_object_vars($node); $settings['revision'] = 1; $settings['isDefaultRevision'] = TRUE; $nodes = array(); $logs = array(); // Get original node. $nodes[] = clone $node; // Create three revisions. $revision_count = 3; for ($i = 0; $i < $revision_count; $i++) { $logs[] = $node->revision_log = $this->randomMachineName(32); // Create revision with a random title and body and update variables. $node->title = $this->randomMachineName(); $node->body = array('value' => $this->randomMachineName(32), 'format' => filter_default_format()); $node->setNewRevision(); $node->save(); $node = node_load($node->id()); // Make sure we get revision information. $nodes[] = clone $node; } $this->nodes = $nodes; $this->revisionLogs = $logs; }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports', 'bypass node access')); $this->drupalLogin($admin_user); $this->webUser = $this->drupalCreateUser(); }
function setUp() { parent::setUp(); // Create a user and log in. $admin_user = $this->drupalCreateUser(array('administer blocks')); $this->drupalLogin($admin_user); }
protected function setUp() { parent::setUp(); // Create a user that has no access to change the state of the node. $this->webUser = $this->drupalCreateUser(array('create article content', 'edit own article content')); // Create a user that has access to change the state of the node. $this->adminUser = $this->drupalCreateUser(array('administer nodes', 'bypass node access')); }
function setUp() { 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); $this->web_user = $web_user; }
protected function setUp() { parent::setUp(); // Use bypass node access permission here, because the test class uses // hook_grants_alter() to deny access to everyone on node_access // queries. $user = $this->drupalCreateUser(array('bypass node access', 'access content', 'create article content')); $this->drupalLogin($user); }
function setUp() { parent::setUp(); // Remove the "view own unpublished content" permission which is set // by default for authenticated users so we can test this permission // correctly. user_role_revoke_permissions(DRUPAL_AUTHENTICATED_RID, array('view own unpublished content')); $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'access content overview', 'administer nodes', 'bypass node access')); $this->base_user_1 = $this->drupalCreateUser(array('access content overview')); $this->base_user_2 = $this->drupalCreateUser(array('access content overview', 'view own unpublished content')); $this->base_user_3 = $this->drupalCreateUser(array('access content overview', 'bypass node access')); }
protected function setUp() { parent::setUp(); node_access_rebuild(); // Create some users. $this->admin_user = $this->drupalCreateUser(array('access content', 'bypass node access')); $this->content_admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields')); // Add a custom field to the page content type. $this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name'); entity_create('field_storage_config', array('field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'text'))->save(); entity_create('field_config', array('field_name' => $this->field_name, 'entity_type' => 'node', 'bundle' => 'page'))->save(); entity_get_display('node', 'page', 'default')->setComponent($this->field_name)->save(); entity_get_form_display('node', 'page', 'default')->setComponent($this->field_name)->save(); }
protected function setUp() { parent::setUp(); node_access_rebuild(); // Create some content. $this->drupalCreateNode(); $this->drupalCreateNode(); $this->drupalCreateNode(); $this->drupalCreateNode(); // Create user with simple node access permission. The 'node test view' // permission is implemented and granted by the node_access_test module. $this->accessUser = $this->drupalCreateUser(array('access content overview', 'access content', 'node test view')); $this->noAccessUser = $this->drupalCreateUser(array('access content overview', 'access content')); $this->noAccessUser2 = $this->drupalCreateUser(array('access content overview', 'access content')); }
function setUp() { parent::setUp(); $types = array('page', 'article'); foreach ($types as $type) { // Create a node with several revisions. $nodes[$type] = $this->drupalCreateNode(array('type' => $type)); $this->node_revisions[$type][] = $nodes[$type]; for ($i = 0; $i < 3; $i++) { // Create a revision for the same nid and settings with a random log. $revision = clone $nodes[$type]; $revision->setNewRevision(); $revision->revision_log = $this->randomMachineName(32); $revision->save(); $this->node_revisions[$type][] = $revision; } } }
protected function setUp() { parent::setUp(); $this->web_user = $this->drupalCreateUser(array('edit own page content', 'create page content')); $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes')); }
protected function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('create article content', 'create page content')); $this->drupalLogin($web_user); }
protected function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('create page content', 'administer content types', 'access user profiles')); $this->drupalLogin($web_user); }
function setUp() { parent::setUp(); // Clear permissions for authenticated users. $this->container->get('config.factory')->get('user.role.' . DRUPAL_AUTHENTICATED_RID)->set('permissions', array())->save(); }
function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer languages', 'administer site configuration')); $this->drupalLogin($web_user); }