You are here

public function ViewExecutableTest::testViewsHandlerTypes in Views (for Drupal 7) 8.3

Tests ViewExecutable::viewsHandlerTypes().

File

lib/Drupal/views/Tests/ViewExecutableTest.php, line 199
Definition of Drupal\views\Tests\ViewExecutableTest.

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\views\Tests

Code

public function testViewsHandlerTypes() {
  $types = ViewExecutable::viewsHandlerTypes();
  foreach (array(
    '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
        ->assertEqual($types[$type]['plural'], $type);
    }
    else {
      $this
        ->assertEqual($types[$type]['plural'], $type . 's');
    }
  }
}