You are here

public function DateTest::testFormatIntervalZeroSecond in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Datetime/DateTest.php \Drupal\Tests\Core\Datetime\DateTest::testFormatIntervalZeroSecond()
  2. 10 core/tests/Drupal/Tests/Core/Datetime/DateTest.php \Drupal\Tests\Core\Datetime\DateTest::testFormatIntervalZeroSecond()

Tests the formatInterval method for 0 second.

File

core/tests/Drupal/Tests/Core/Datetime/DateTest.php, line 151

Class

DateTest
@coversDefaultClass \Drupal\Core\Datetime\DateFormatter @group Datetime

Namespace

Drupal\Tests\Core\Datetime

Code

public function testFormatIntervalZeroSecond() {
  $result = $this->dateFormatter
    ->formatInterval(0, 1, 'xxx-lolspeak');
  $this
    ->assertEquals(new TranslatableMarkup('0 sec', [], [
    'langcode' => 'xxx-lolspeak',
  ], $this->stringTranslation), $result);
}