You are here

public function ActivityUiTest::setUp in CRM Core 8.2

Same name and namespace in other branches
  1. 8 modules/crm_core_activity/src/Tests/ActivityUiTest.php \Drupal\crm_core_activity\Tests\ActivityUiTest::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

modules/crm_core_activity/src/Tests/ActivityUiTest.php, line 36

Class

ActivityUiTest
Tests the UI for Activity CRUD operations.

Namespace

Drupal\crm_core_activity\Tests

Code

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

  // Place local actions blocks.
  $this
    ->drupalPlaceBlock('local_actions_block');
  $this
    ->drupalPlaceBlock('local_tasks_block');
  IndividualType::create([
    'name' => 'Customer',
    'type' => 'customer',
    'description' => 'A single customer.',
    'primary_fields' => [],
  ])
    ->save();
  ActivityType::create([
    'type' => 'meeting',
    'name' => 'Meeting',
    'description' => 'A meeting between 2 or more contacts.',
  ])
    ->save();
  ActivityType::create([
    'type' => 'phone_call',
    'name' => 'Phone call',
    'description' => 'A phone call between 2 or more contacts.',
  ])
    ->save();
  $this
    ->drupalPlaceBlock('system_breadcrumb_block');
}