You are here

public function EntityFormTest::testEntityFormDisplayAlter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Entity/EntityFormTest.php \Drupal\Tests\system\Functional\Entity\EntityFormTest::testEntityFormDisplayAlter()
  2. 10 core/modules/system/tests/src/Functional/Entity/EntityFormTest.php \Drupal\Tests\system\Functional\Entity\EntityFormTest::testEntityFormDisplayAlter()

Tests hook_entity_form_display_alter().

Verify that the altered field has the correct size value.

See also

entity_test_entity_form_display_alter()

File

core/modules/system/tests/src/Functional/Entity/EntityFormTest.php, line 103

Class

EntityFormTest
Tests the entity form.

Namespace

Drupal\Tests\system\Functional\Entity

Code

public function testEntityFormDisplayAlter() {
  $this
    ->drupalGet('entity_test/add');
  $altered_field = $this
    ->assertSession()
    ->fieldExists('field_test_text[0][value]');
  $this
    ->assertEquals(42, $altered_field
    ->getAttribute('size'));
}