public function TelephoneFieldTest::testTelephoneFormatter in Drupal 10
Same name and namespace in other branches
- 8 core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php \Drupal\Tests\telephone\Functional\TelephoneFieldTest::testTelephoneFormatter()
- 9 core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php \Drupal\Tests\telephone\Functional\TelephoneFieldTest::testTelephoneFormatter()
Tests the telephone formatter.
@covers \Drupal\telephone\Plugin\Field\FieldFormatter\TelephoneLinkFormatter::viewElements
@dataProvider providerPhoneNumbers
File
- core/
modules/ telephone/ tests/ src/ Functional/ TelephoneFieldTest.php, line 102
Class
- TelephoneFieldTest
- Tests the creation of telephone fields.
Namespace
Drupal\Tests\telephone\FunctionalCode
public function testTelephoneFormatter($input, $expected) {
// Test basic entry of telephone field.
$edit = [
'title[0][value]' => $this
->randomMachineName(),
'field_telephone[0][value]' => $input,
];
$this
->drupalGet('node/add/article');
$this
->submitForm($edit, 'Save');
$this
->assertSession()
->responseContains('<a href="tel:' . $expected . '">');
}