public function ViewExecutableTest::testGetHandlerTypes in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testGetHandlerTypes()
Tests ViewExecutable::getHandlerTypes().
File
- core/
modules/ views/ tests/ src/ Kernel/ ViewExecutableTest.php, line 402
Class
- ViewExecutableTest
- Tests the ViewExecutable class.
Namespace
Drupal\Tests\views\KernelCode
public function testGetHandlerTypes() {
$types = ViewExecutable::getHandlerTypes();
foreach ([
'field',
'filter',
'argument',
'sort',
'header',
'footer',
'empty',
] as $type) {
$this
->assertTrue(isset($types[$type]));
// @todo The key on the display should be footers, headers and empties
// or something similar instead of the singular, but so long check for
// this special case.
if (isset($types[$type]['type']) && $types[$type]['type'] == 'area') {
$this
->assertEquals($type, $types[$type]['plural']);
}
else {
$this
->assertEquals($type . 's', $types[$type]['plural']);
}
}
}