function DateTest::testFormatIntervalZeroSecond

Same name in other branches
  1. 9 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()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.