You are here

public function DomainSourceEntityReferenceTest::testDomainSourceNodeField in Domain Access 8

Tests that the module installed its field correctly.

File

domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php, line 31

Class

DomainSourceEntityReferenceTest
Tests the domain source entity reference field type.

Namespace

Drupal\Tests\domain_source\Functional

Code

public function testDomainSourceNodeField() {
  $this->admin_user = $this
    ->drupalCreateUser([
    'administer content types',
    'administer node fields',
    'administer node display',
    'administer domains',
  ]);
  $this
    ->drupalLogin($this->admin_user);

  // Visit the article field administration page.
  $this
    ->drupalGet('admin/structure/types/manage/article/fields');
  $this
    ->assertResponse(200, 'Manage fields page sourceed.');

  // Check for a domain field.
  $this
    ->assertText('Domain Source', 'Domain form field found.');

  // Visit the article field display administration page.
  $this
    ->drupalGet('admin/structure/types/manage/article/display');
  $this
    ->assertResponse(200, 'Manage field display page sourceed.');

  // Check for a domain field.
  $this
    ->assertText('Domain Source', 'Domain form field found.');
}