You are here

protected function DisableFieldTestTrait::checkIfFieldIsNotDisabledByFieldName in Disable Field 8.2

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

Parameters

string $field_name: The field name to check.

8 calls to DisableFieldTestTrait::checkIfFieldIsNotDisabledByFieldName()
DisableFieldTest::testDisableFieldKeepValuesOnDisabledState in tests/src/Functional/DisableFieldTest.php
Test that a disabled field keeps it's value.
DisableFieldTest::testDisableFieldOnAddFormDisableForCertainRoles in tests/src/Functional/DisableFieldTest.php
Disable the field for certain roles on the content add form.
DisableFieldTest::testDisableFieldOnAddFormEnableForAllRoles in tests/src/Functional/DisableFieldTest.php
Enable the field for all roles on the content add form.
DisableFieldTest::testDisableFieldOnAddFormEnableForCertainRoles in tests/src/Functional/DisableFieldTest.php
Enable the field for certain roles on the content edit form.
DisableFieldTest::testDisableFieldOnEditFormDisableForAllRoles in tests/src/Functional/DisableFieldTest.php
Disable the field for all roles on the content edit form.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\disable_field\Traits

Code

protected function checkIfFieldIsNotDisabledByFieldName(string $field_name) {
  $this
    ->checkIfFieldIsNotDisabledById(sprintf('edit-%s-0-value', str_replace('_', '-', $field_name)));
}