You are here

public function DateTest::testLegacyMaxAgeFormattedDateDiff in Drupal 8

Tests FormattedDateDiff.

@covers \Drupal\Core\Datetime\FormattedDateDiff::getMaxAge @group legacy @expectedDeprecation Drupal\Core\Datetime\FormattedDateDiff::getMaxAge() is deprecated in drupal:8.1.9 and is removed from drupal:9.0.0. Use \Drupal\Core\Datetime\FormattedDateDiff::getCacheMaxAge() instead. See https://www.drupal.org/node/2783545

File

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

Class

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

Namespace

Drupal\Tests\Core\Datetime

Code

public function testLegacyMaxAgeFormattedDateDiff() {
  $string = '10 minutes';
  $max_age = 60;
  $object = new FormattedDateDiff($string, $max_age);
  $this
    ->assertSame($object
    ->getCacheMaxAge(), $object
    ->getMaxAge());
}