You are here

public function TimeTest::testItFormatsForWidgetsInExpectedFormat in Time Field For Drupal 8.x / 9.x 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/TimeTest.php \Drupal\Tests\time_field\Unit\TimeTest::testItFormatsForWidgetsInExpectedFormat()

Test it formats for widgets in expected format.

File

tests/src/Unit/TimeTest.php, line 58

Class

TimeTest
Tests time.

Namespace

Drupal\Tests\time_field\Unit

Code

public function testItFormatsForWidgetsInExpectedFormat() {
  $time = new Time(13, 40, 30);
  $this
    ->assertEquals('13:40:30', $time
    ->formatForWidget());
}