You are here

public function DateTest::testFormatIntervalZeroSecond in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 154
Contains \Drupal\Tests\Core\Datetime\DateTest.

Class

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

Namespace

Drupal\Tests\Core\Datetime

Code

public function testFormatIntervalZeroSecond() {
  $this->stringTranslation
    ->expects($this
    ->once())
    ->method('translate')
    ->with('0 sec', array(), array(
    'langcode' => 'xxx-lolspeak',
  ))
    ->will($this
    ->returnValue('0 sec'));
  $result = $this->dateFormatter
    ->formatInterval(0, 1, 'xxx-lolspeak');
  $this
    ->assertEquals('0 sec', $result);
}