You are here

public function TelephoneFieldTest::testTelephoneWidget in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php \Drupal\Tests\telephone\Functional\TelephoneFieldTest::testTelephoneWidget()

Tests to confirm the widget is setup.

@covers \Drupal\telephone\Plugin\Field\FieldWidget\TelephoneDefaultWidget::formElement

File

core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php, line 89

Class

TelephoneFieldTest
Tests the creation of telephone fields.

Namespace

Drupal\Tests\telephone\Functional

Code

public function testTelephoneWidget() {
  $this
    ->drupalGet('node/add/article');
  $this
    ->assertSession()
    ->fieldValueEquals("field_telephone[0][value]", '');
  $this
    ->assertSession()
    ->responseContains('placeholder="123-456-7890"');
}