You are here

public function IndividualUiTest::testListBuilder in CRM Core 8.2

Same name and namespace in other branches
  1. 8 modules/crm_core_contact/src/Tests/IndividualUiTest.php \Drupal\crm_core_contact\Tests\IndividualUiTest::testListBuilder()

Test list builder views for contact entities.

File

modules/crm_core_contact/src/Tests/IndividualUiTest.php, line 341

Class

IndividualUiTest
Tests the UI for Individual CRUD operations.

Namespace

Drupal\crm_core_contact\Tests

Code

public function testListBuilder() {
  $user = $this
    ->drupalCreateUser([
    'view any crm_core_individual entity',
    'view any crm_core_organization entity',
    'administer views',
  ]);
  $this
    ->drupalLogin($user);

  // Delete created organization view to get default view from list builder.
  $this
    ->drupalGet('admin/structure/views/view/crm_core_organizaiton_overview/delete');
  $this
    ->drupalPostForm(NULL, [], TRUE);

  // Check organization collection page.
  $this
    ->drupalGet('/crm-core/organization');
  $this
    ->assertResponse(200);

  // Delete created individual view to get default view from list builder.
  $this
    ->drupalGet('admin/structure/views/view/crm_core_individual_overview/delete');
  $this
    ->drupalPostForm(NULL, [], TRUE);

  // Assert response on individual collection page.
  $this
    ->drupalGet('/crm-core/individual');
  $this
    ->assertResponse(200);
}