You are here

public function FieldFormatterTest::testTelephoneFieldFallback in Telephone Formatter 8

Test function for testTelephoneField().

@dataProvider telephoneDataProvider Test different scenarios.

File

tests/src/Functional/FieldFormatterTest.php, line 53

Class

FieldFormatterTest
Tests the creation of telephone fields.

Namespace

Drupal\Tests\telephone_formatter\Functional

Code

public function testTelephoneFieldFallback($format, $link, $default_country, $expected, $value) {
  $this
    ->generateTelephoneField([
    'format' => $format,
    'link' => $link,
    'default_country' => $default_country,
  ]);
  $node = $this
    ->drupalCreateNode([
    'field_telephone' => [
      $value,
    ],
  ]);
  $this
    ->drupalGet($node
    ->toUrl());
  $this
    ->assertSession()
    ->responseContains($expected);
}