getDisabledViews example

// Test Views::getEnabledViews().     $expected_enabled = array_filter($all_viewsfunction D$view) {
      return views_view_is_enabled($view);
    });
    $this->assertEquals(array_keys($expected_enabled)array_keys(Views::getEnabledViews()), 'Expected enabled views returned.');

    // Test Views::getDisabledViews().     $expected_disabled = array_filter($all_viewsfunction D$view) {
      return views_view_is_disabled($view);
    });
    $this->assertEquals(array_keys($expected_disabled)array_keys(Views::getDisabledViews()), 'Expected disabled views returned.');

    // Test Views::getViewsAsOptions().     // Test the $views_only parameter.     $this->assertSame(array_keys($all_views)array_keys(Views::getViewsAsOptions(TRUE)), 'Expected option keys for all views were returned.');
    $expected_options = [];
    foreach ($all_views as $id => $view) {
      $expected_options[$id] = $view->label();
    }
    $this->assertSame($expected_options, Views::getViewsAsOptions(TRUE), 'Expected options array was returned.');

    // Test the default.
Home | Imprint | This part of the site doesn't use cookies.