function TelephoneFieldTest::testTelephoneWidget

Same name in other branches
  1. 9 core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php \Drupal\Tests\telephone\Functional\TelephoneFieldTest::testTelephoneWidget()
  2. 10 core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php \Drupal\Tests\telephone\Functional\TelephoneFieldTest::testTelephoneWidget()
  3. 11.x 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"');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.