/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $admin_roles = $this->adminUser->getRoles();
     $admin_role = Role::load(reset($admin_roles));
     $this->grantPermissions($admin_role, ['administer site configuration']);
 }
Exemplo n.º 2
0
 protected function setUp()
 {
     parent::setUp();
     // Enable anonymous and authenticated user comments.
     user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access comments', 'post comments', 'skip comment approval'));
     user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access comments', 'post comments', 'skip comment approval'));
 }
Exemplo n.º 3
0
 public function setUp()
 {
     parent::setUp();
     // Enables anonymous user comments.
     user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array('access comments' => TRUE, 'post comments' => TRUE, 'skip comment approval' => TRUE));
     // Allows anonymous to leave their contact information.
     $this->setCommentAnonymous(COMMENT_ANONYMOUS_MAY_CONTACT);
     $this->setCommentPreview(DRUPAL_OPTIONAL);
     $this->setCommentForm(TRUE);
     $this->setCommentSubject(TRUE);
     $this->setCommentSettings('comment_default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Comment paging changed.');
     // Prepares commonly used URIs.
     $this->base_uri = url('<front>', array('absolute' => TRUE));
     $this->node_uri = url('node/' . $this->node->id(), array('absolute' => TRUE));
     // Set relation between node and comment.
     $article_mapping = rdf_get_mapping('node', 'article');
     $comment_count_mapping = array('properties' => array('sioc:num_replies'), 'datatype' => 'xsd:integer', 'datatype_callback' => array('callable' => 'Drupal\\rdf\\CommonDataConverter::rawValue'));
     $article_mapping->setFieldMapping('comment_count', $comment_count_mapping)->save();
     // Save user mapping.
     $user_mapping = rdf_get_mapping('user', 'user');
     $username_mapping = array('properties' => array('foaf:name'));
     $user_mapping->setFieldMapping('name', $username_mapping)->save();
     $user_mapping->setFieldMapping('homepage', array('properties' => array('foaf:page'), 'mapping_type' => 'rel'))->save();
     // Save comment mapping.
     $mapping = rdf_get_mapping('comment', 'comment');
     $mapping->setBundleMapping(array('types' => array('sioc:Post', 'sioct:Comment')))->save();
     $field_mappings = array('subject' => array('properties' => array('dc:title')), 'created' => array('properties' => array('dc:date', 'dc:created'), 'datatype' => 'xsd:dateTime', 'datatype_callback' => array('callable' => 'date_iso8601')), 'changed' => array('properties' => array('dc:modified'), 'datatype' => 'xsd:dateTime', 'datatype_callback' => array('callable' => 'date_iso8601')), 'comment_body' => array('properties' => array('content:encoded')), 'pid' => array('properties' => array('sioc:reply_of'), 'mapping_type' => 'rel'), 'uid' => array('properties' => array('sioc:has_creator'), 'mapping_type' => 'rel'), 'name' => array('properties' => array('foaf:name')));
     // Iterate over shared field mappings and save.
     foreach ($field_mappings as $field_name => $field_mapping) {
         $mapping->setFieldMapping($field_name, $field_mapping)->save();
     }
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create a test user.
     $this->adminUser = $this->drupalCreateUser(array('access content', 'admin classes', 'admin display suite', 'admin fields', 'administer nodes', 'view all revisions', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer permissions', 'administer account settings', 'administer user display', 'administer software updates', 'access site in maintenance mode', 'administer site configuration', 'bypass node access', 'administer comments', 'administer comment types', 'administer comment fields', 'administer comment display', 'skip comment approval', 'post comments', 'access comments', 'access user profiles'));
     $this->drupalLogin($this->adminUser);
 }
Exemplo n.º 5
0
 protected function setUp()
 {
     parent::setUp();
     node_access_rebuild();
     // Re-create user.
     $this->webUser = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments', 'node test view', 'skip comment approval'));
     // Set the author of the created node to the web_user uid.
     $this->node->setOwnerId($this->webUser->id())->save();
 }
Exemplo n.º 6
0
 /**
  * Set up comments to have subject and preview disabled.
  */
 public function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     $this->setCommentPreview(DRUPAL_DISABLED);
     $this->setCommentForm(TRUE);
     $this->setCommentSubject(FALSE);
     $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Comment paging changed.');
     $this->drupalLogout();
 }
 /**
  * Set up comments to have subject and preview disabled.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     // Make sure that comment field title is not displayed when there's no
     // comments posted.
     $this->drupalGet($this->node->urlInfo());
     $this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments title is not displayed.');
     // Set comments to have subject and preview disabled.
     $this->setCommentPreview(DRUPAL_DISABLED);
     $this->setCommentForm(TRUE);
     $this->setCommentSubject(FALSE);
     $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Comment paging changed.');
     $this->drupalLogout();
 }
 /**
  * Sets the test up.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser($this->permissions);
 }
Exemplo n.º 9
0
 protected function setUp()
 {
     parent::setUp();
     // Create a second user to post comments.
     $this->webUser2 = $this->drupalCreateUser(array('post comments', 'create article content', 'edit own comments', 'post comments', 'skip comment approval', 'access comments', 'access content'));
 }
Exemplo n.º 10
0
 /**
  * Sets the test up.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('page_title_block');
     $this->adminUser = $this->drupalCreateUser($this->permissions);
 }
Exemplo n.º 11
0
 protected function setUp()
 {
     parent::setUp();
     // Update admin user to have the 'administer blocks' permission.
     $this->adminUser = $this->drupalCreateUser(array('administer content types', 'administer comments', 'skip comment approval', 'post comments', 'access comments', 'access content', 'administer blocks'));
 }
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('page_title_block');
 }
Exemplo n.º 13
0
 protected function setUp()
 {
     parent::setUp();
     // Allow anonymous users to see comments.
     user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access comments', 'access content'));
 }
Exemplo n.º 14
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Setup the rss view display.
     EntityViewDisplay::create(['status' => TRUE, 'targetEntityType' => 'node', 'bundle' => 'article', 'mode' => 'rss', 'content' => ['links' => ['weight' => 100]]])->save();
 }
Exemplo n.º 15
0
 function setUp()
 {
     parent::setUp();
     // Allow anonymous users to see comments.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments', 'access content'));
 }