You are here

protected function DurationFieldFunctionalTest::setHumanReadableOptions in Duration Field 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/DurationFieldFunctionalTest.php \Drupal\Tests\duration_field\Functional\DurationFieldFunctionalTest::setHumanReadableOptions()

Sets some human readable options.

1 call to DurationFieldFunctionalTest::setHumanReadableOptions()
DurationFieldFunctionalTest::testHumanReadableFormatter in tests/src/Functional/DurationFieldFunctionalTest.php
Tests the Human Friendly duration field formatter outputs correct data.

File

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

Class

DurationFieldFunctionalTest
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);
}