function FieldUiTestTrait::assertFieldDoesNotExistOnOverview

Same name and namespace in other branches
  1. 10 core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php \Drupal\Tests\field_ui\Traits\FieldUiTestTrait::assertFieldDoesNotExistOnOverview()

Asserts that the field does not appear on the overview form.

Parameters

string $label: The field label.

1 call to FieldUiTestTrait::assertFieldDoesNotExistOnOverview()
FieldUiTestTrait::assertFieldDoesNotExist in core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php
Asserts that the field doesn't exist in the overview form.

File

core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php, line 260

Class

FieldUiTestTrait
Provides common functionality for the Field UI test classes.

Namespace

Drupal\Tests\field_ui\Traits

Code

protected function assertFieldDoesNotExistOnOverview(string $label) {
    $xpath = $this->assertSession()
        ->buildXPathQuery("//table[@id=\"field-overview\"]//tr/td[1 and text() = :label]", [
        ':label' => $label,
    ]);
    $element = $this->getSession()
        ->getPage()
        ->find('xpath', $xpath);
    $this->assertSession()
        ->assert($element === NULL, sprintf('A field "%s" appears on this page, but it should not.', $label));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.