FieldTimeIntervalTest::$ages

Same name and namespace in other branches
  1. 10 core/modules/views/tests/src/Kernel/Handler/FieldTimeIntervalTest.php \Drupal\Tests\views\Kernel\Handler\FieldTimeIntervalTest::ages
  2. 11.x core/modules/views/tests/src/Kernel/Handler/FieldTimeIntervalTest.php \Drupal\Tests\views\Kernel\Handler\FieldTimeIntervalTest::ages

Ages dataset.

Type: array

File

core/modules/views/tests/src/Functional/Handler/FieldTimeIntervalTest.php, line 36

Class

FieldTimeIntervalTest
Tests the time interval handler.

Namespace

Drupal\Tests\views\Functional\Handler

Code

protected $ages = [
  [
    0,
    '0 sec',
    2,
  ],
  [
    1000,
    '16 min',
    1,
  ],
  [
    1000000,
    '1 week 4 days 13 hours 46 min',
    4,
  ],
  // DateFormatter::formatInterval will output 2 because there are no weeks.
[
    100000000,
    '3 years 2 months',
    5,
  ],
  [
    NULL,
    '',
    3,
  ],
];

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