You are here

protected function DurationFieldAccessTest::setHumanReadableOptions in Duration Field 8

Sets some human readable options.

1 call to DurationFieldAccessTest::setHumanReadableOptions()
DurationFieldAccessTest::testHumanReadableAll in tests/src/Functional/DurationFieldFunctionalTest.php
Tests human readable values.

File

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

Class

DurationFieldAccessTest
Functional tests for the Duration Field module.

Namespace

Drupal\Tests\duration_field\Functional

Code

protected function setHumanReadableOptions($text_length = 'full', $separator = 'space') {
  $this
    ->drupalGet('/admin/structure/types/manage/test_type/display');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->click('#edit-fields-field-duration-settings-edit');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->selectSelectOption('#edit-fields-field-duration-settings-edit-form-settings-text-length', $text_length);
  $this
    ->selectSelectOption('#edit-fields-field-duration-settings-edit-form-settings-separator', $separator);
  $this
    ->click('#edit-fields-field-duration-settings-edit-form-actions-save-settings');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->click('#edit-submit');
  $this
    ->assertStatusCodeEquals(200);
}