You are here

public function DurationFieldFunctionalTest::testHumanReadableDate in Duration Field 8.2

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

Tests human readable date field formatter.

File

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

Class

DurationFieldFunctionalTest
Functional tests for the Duration Field module.

Namespace

Drupal\Tests\duration_field\Functional

Code

public function testHumanReadableDate() {
  $this
    ->createDefaultSetup([
    'y',
    'm',
    'd',
  ]);
  $this
    ->fillTextValue('#edit-title-0-value', 'Dummy Title');
  $this
    ->fillTextValue('#edit-field-duration-0-duration-y', 6);
  $this
    ->fillTextValue('#edit-field-duration-0-duration-m', 5);
  $this
    ->fillTextValue('#edit-field-duration-0-duration-d', 4);
  $this
    ->click('input[name="op"]');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->assertTextExists('6 years 5 months 4 days');
  $this
    ->assertTextNotExists('minute');
}