You are here

public function DurationFieldAccessTest::testHumanReadableDate in Duration Field 8

Tests human readable dates.

File

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

Class

DurationFieldAccessTest
Functional tests for the Duration Field module.

Namespace

Drupal\Tests\duration_field\Functional

Code

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