You are here

protected function DurationFieldAccessTest::setFormatter in Duration Field 8

Sets the formatter to be tested.

4 calls to DurationFieldAccessTest::setFormatter()
DurationFieldAccessTest::testRawValue in tests/src/Functional/DurationFieldFunctionalTest.php
Tests raw values.
DurationFieldAccessTest::testTimeDate in tests/src/Functional/DurationFieldFunctionalTest.php
Tests the date part of a time.
DurationFieldAccessTest::testTimeFull in tests/src/Functional/DurationFieldFunctionalTest.php
Tests full time output.
DurationFieldAccessTest::testTimeTime in tests/src/Functional/DurationFieldFunctionalTest.php
Tests the time part of a time.

File

tests/src/Functional/DurationFieldFunctionalTest.php, line 240

Class

DurationFieldAccessTest
Functional tests for the Duration Field module.

Namespace

Drupal\Tests\duration_field\Functional

Code

protected function setFormatter($formatter) {
  $types = [
    'human' => 'duration_human_display',
    'time' => 'duration_time_display',
    'raw' => 'duration_raw_value_display',
  ];
  $this
    ->drupalGet('/admin/structure/types/manage/test_type/display');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->selectSelectOption('#edit-fields-field-duration-type', $types[$formatter]);
  $this
    ->click('#edit-submit');
}