You are here

protected function EntityconnectTestBase::setUp in Entity connect 8.2

Overrides BrowserTestBase::setUp

3 calls to EntityconnectTestBase::setUp()
EntityconnectAddTest::setUp in tests/src/Functional/EntityconnectAddTest.php
EntityconnectAdminTest::setUp in tests/src/Functional/EntityconnectAdminTest.php
EntityconnectEditTest::setUp in tests/src/Functional/EntityconnectEditTest.php
3 methods override EntityconnectTestBase::setUp()
EntityconnectAddTest::setUp in tests/src/Functional/EntityconnectAddTest.php
EntityconnectAdminTest::setUp in tests/src/Functional/EntityconnectAdminTest.php
EntityconnectEditTest::setUp in tests/src/Functional/EntityconnectEditTest.php

File

tests/src/Functional/EntityconnectTestBase.php, line 64

Class

EntityconnectTestBase
EntityConnect Test Base.

Namespace

Drupal\Tests\entityconnect\Functional

Code

protected function setUp() {
  parent::setUp();

  // Create a test content type.
  $this->testContentType = $this
    ->drupalCreateContentType([
    'type' => 'ec_test',
    'name' => 'EC Test',
  ]);

  // Place the title block.
  $this
    ->drupalPlaceBlock('page_title_block');

  // Add an entity reference field.
  $this->testRefField = $this
    ->addContentEntityReferenceField();

  // Create users.
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer entityconnect',
    'administer site configuration',
    'administer content types',
    'administer node fields',
  ]);
  $this
    ->drupalCreateRole([
    'entityconnect add button',
  ], 'ec_add');
  $this
    ->drupalCreateRole([
    'entityconnect edit button',
  ], 'ec_edit');
  $this->ecUser = $this
    ->drupalCreateUser([
    "create {$this->testContentType->id()} content",
    "edit any {$this->testContentType->id()} content",
  ]);
}