You are here

public function DurationFieldAccessTest::testTimeTime in Duration Field 8

Tests the time part of a time.

File

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

Class

DurationFieldAccessTest
Functional tests for the Duration Field module.

Namespace

Drupal\Tests\duration_field\Functional

Code

public function testTimeTime() {
  $this
    ->createDefaultSetup([
    'hour',
    'minute',
    'second',
  ]);
  $this
    ->setFormatter('time');
  $this
    ->drupalGet('node/add/test_type');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->assertSession()
    ->addressMatches('/^\\/node\\/add\\/test_type$/');
  $this
    ->fillTextValue('#edit-title-0-value', 'Dummy Title');
  $this
    ->fillTextValue('#edit-field-duration-0-value-hour', 4);
  $this
    ->fillTextValue('#edit-field-duration-0-value-minute', 5);
  $this
    ->fillTextValue('#edit-field-duration-0-value-second', 6);
  $this
    ->click('input[name="op"]');
  $this
    ->assertStatusCodeEquals(200);
  $this
    ->assertTextExists('4:05:06');
}