You are here

protected function DisableFieldTestTrait::checkIfFieldIsNotDisabledById in Disable Field 8.2

Check if the given field with the given ID exists, but is not disabled.

Parameters

string $id: The ID to check.

1 call to DisableFieldTestTrait::checkIfFieldIsNotDisabledById()
DisableFieldTestTrait::checkIfFieldIsNotDisabledByFieldName in tests/src/Traits/DisableFieldTestTrait.php
Check if the given field exists, but is not disabled.

File

tests/src/Traits/DisableFieldTestTrait.php, line 28

Class

DisableFieldTestTrait
Provides methods to simplify checking if a field is disabled or not.

Namespace

Drupal\Tests\disable_field\Traits

Code

protected function checkIfFieldIsNotDisabledById(string $id) {
  $this
    ->assertSession()
    ->elementExists('css', sprintf('#%s', $id));
  $this
    ->assertSession()
    ->elementNotExists('css', sprintf('#%s[disabled]', $id));
}