function FieldTimeIntervalTest::testFieldTimeInterval
Same name in other branches
- 9 core/modules/views/tests/src/Functional/Handler/FieldTimeIntervalTest.php \Drupal\Tests\views\Functional\Handler\FieldTimeIntervalTest::testFieldTimeInterval()
- 11.x core/modules/views/tests/src/Kernel/Handler/FieldTimeIntervalTest.php \Drupal\Tests\views\Kernel\Handler\FieldTimeIntervalTest::testFieldTimeInterval()
Tests the TimeInterval handler.
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ FieldTimeIntervalTest.php, line 46
Class
- FieldTimeIntervalTest
- Tests the time interval handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testFieldTimeInterval() : void {
$view = Views::getView('test_view');
$view->setDisplay();
$this->executeView($view);
foreach ($view->result as $delta => $row) {
[
,
$formatted_value,
$granularity,
] = $this->ages[$delta];
$view->field['age']->options['granularity'] = $granularity;
$this->assertEquals($formatted_value, $view->field['age']
->advancedRender($row));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.