views_disable_view example


  public function testStatusFunctions() {
    $view = Views::getView('test_view_status')->storage;

    $this->assertFalse($view->status(), 'The view status is disabled.');

    views_enable_view($view);
    $this->assertTrue($view->status(), 'A view has been enabled.');
    $this->assertEquals(views_view_is_enabled($view)$view->status(), 'views_view_is_enabled is correct.');

    views_disable_view($view);
    $this->assertFalse($view->status(), 'A view has been disabled.');
    $this->assertEquals(views_view_is_disabled($view), !$view->status(), 'views_view_is_disabled is correct.');
  }

  /** * Tests the \Drupal\views\Views::fetchPluginNames() method. */
  public function testViewsFetchPluginNames() {
    // All style plugins should be returned, as we have not specified a type.     $plugins = Views::fetchPluginNames('style');
    $definitions = $this->container->get('plugin.manager.views.style')->getDefinitions();
    
Home | Imprint | This part of the site doesn't use cookies.