You are here

public function TelephoneFieldTest::testTelephoneWidget in Drupal 8

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

Test 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
    ->assertFieldByName("field_telephone[0][value]", '', 'Widget found.');
  $this
    ->assertRaw('placeholder="123-456-7890"');
}