You are here

public function ExtraFieldDisplayUITest::testOneNodeTypePlugin in Extra Field 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/ExtraFieldDisplayUITest.php \Drupal\Tests\extra_field\Functional\ExtraFieldDisplayUITest::testOneNodeTypePlugin()

Test if OneNodeType plugin is displayed on entity display pages.

File

tests/src/Functional/ExtraFieldDisplayUITest.php, line 54

Class

ExtraFieldDisplayUITest
Tests the extra field Display on entity UI pages.

Namespace

Drupal\Tests\extra_field\Functional

Code

public function testOneNodeTypePlugin() {

  // Check presence 'first_node_type' display page.
  $this
    ->drupalGet($this->manageDisplayUrl['first_node_type']);
  $this
    ->assertSession()
    ->pageTextContains('Extra field for first node type');

  // Check enabled/disabled and weight.
  $this
    ->assertSession()
    ->fieldValueEquals('fields[extra_field_one_node_type_test][region]', 'hidden');
  $this
    ->assertSession()
    ->fieldValueEquals('fields[extra_field_one_node_type_test][weight]', '0');

  // Check presence 'another_node_type' display page.
  $this
    ->drupalGet($this->manageDisplayUrl['another_node_type']);
  $this
    ->assertSession()
    ->pageTextNotContains('Extra field for first node type');
}