function ViewExecutableTest::testDestroy

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testDestroy()
  2. 8.9.x core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testDestroy()
  3. 10 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testDestroy()

Tests the destructor to be sure that necessary objects are removed.

File

core/modules/views/tests/src/Kernel/ViewExecutableTest.php, line 362

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\Tests\views\Kernel

Code

public function testDestroy() : void {
    $view = Views::getView('test_destroy');
    $view->preview();
    $view->destroy();
    $this->assertViewDestroy($view);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.