You are here

NodeAccessRebuildTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/node/src/Tests/NodeAccessRebuildTest.php

Namespace

Drupal\node\Tests

File

core/modules/node/src/Tests/NodeAccessRebuildTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\node\Tests\NodeAccessRebuildTest.
 */
namespace Drupal\node\Tests;


/**
 * Ensures that node access rebuild functions work correctly.
 *
 * @group node
 */
class NodeAccessRebuildTest extends NodeTestBase {

  /**
   * A normal authenticated user.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $webUser;
  protected function setUp() {
    parent::setUp();
    $web_user = $this
      ->drupalCreateUser(array(
      'administer site configuration',
      'access administration pages',
      'access site reports',
    ));
    $this
      ->drupalLogin($web_user);
    $this->webUser = $web_user;
  }

  /**
   * Tests rebuilding the node access permissions table.
   */
  function testNodeAccessRebuild() {
    $this
      ->drupalGet('admin/reports/status');
    $this
      ->clickLink(t('Rebuild permissions'));
    $this
      ->drupalPostForm(NULL, array(), t('Rebuild permissions'));
    $this
      ->assertText(t('Content permissions have been rebuilt.'));
  }

}

Classes

Namesort descending Description
NodeAccessRebuildTest Ensures that node access rebuild functions work correctly.