You are here

protected function ModuleTest::formatViewOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ModuleTest.php \Drupal\views\Tests\ModuleTest::formatViewOptions()

Helper to return an expected views option array.

Parameters

array $views: An array of Drupal\views\Entity\View objects for which to create an options array.

Return value

array A formatted options array that matches the expected output.

1 call to ModuleTest::formatViewOptions()
ModuleTest::testLoadFunctions in core/modules/views/src/Tests/ModuleTest.php
Tests the load wrapper/helper functions.

File

core/modules/views/src/Tests/ModuleTest.php, line 346
Contains \Drupal\views\Tests\ModuleTest.

Class

ModuleTest

Namespace

Drupal\views\Tests

Code

protected function formatViewOptions(array $views = array()) {
  $expected_options = array();
  foreach ($views as $view) {
    foreach ($view
      ->get('display') as $display) {
      $expected_options[$view
        ->id() . ':' . $display['id']] = (string) t('View: @view - Display: @display', array(
        '@view' => $view
          ->id(),
        '@display' => $display['id'],
      ));
    }
  }
  return $expected_options;
}