You are here

protected function TrackerTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/tracker/src/Tests/TrackerTest.php \Drupal\tracker\Tests\TrackerTest::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/tracker/src/Tests/TrackerTest.php, line 51
Contains \Drupal\tracker\Tests\TrackerTest.

Class

TrackerTest
Create and delete nodes and check for their display in the tracker listings.

Namespace

Drupal\tracker\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->drupalCreateContentType(array(
    'type' => 'page',
    'name' => 'Basic page',
  ));
  $permissions = array(
    'access comments',
    'create page content',
    'post comments',
    'skip comment approval',
  );
  $this->user = $this
    ->drupalCreateUser($permissions);
  $this->otherUser = $this
    ->drupalCreateUser($permissions);
  $this
    ->addDefaultCommentField('node', 'page');
  user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, array(
    'access content',
    'access user profiles',
  ));
  $this
    ->drupalPlaceBlock('local_tasks_block', [
    'id' => 'page_tabs_block',
  ]);
  $this
    ->drupalPlaceBlock('local_actions_block', [
    'id' => 'page_actions_block',
  ]);
}