You are here

protected function ForumTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/src/Tests/ForumTest.php \Drupal\forum\Tests\ForumTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

File

core/modules/forum/src/Tests/ForumTest.php, line 83
Contains \Drupal\forum\Tests\ForumTest.

Class

ForumTest
Create, view, edit, delete, and change forum entries and verify its consistency in the database.

Namespace

Drupal\forum\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->drupalPlaceBlock('system_breadcrumb_block');
  $this
    ->drupalPlaceBlock('page_title_block');

  // Create users.
  $this->adminUser = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'administer modules',
    'administer blocks',
    'administer forums',
    'administer menu',
    'administer taxonomy',
    'create forum content',
    'access comments',
  ));
  $this->editAnyTopicsUser = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'create forum content',
    'edit any forum content',
    'delete any forum content',
  ));
  $this->editOwnTopicsUser = $this
    ->drupalCreateUser(array(
    'create forum content',
    'edit own forum content',
    'delete own forum content',
  ));
  $this->webUser = $this
    ->drupalCreateUser();
  $this->postCommentUser = $this
    ->drupalCreateUser(array(
    'administer content types',
    'create forum content',
    'post comments',
    'skip comment approval',
    'access comments',
  ));
  $this
    ->drupalPlaceBlock('help_block', array(
    'region' => 'help',
  ));
  $this
    ->drupalPlaceBlock('local_actions_block');
}