protected function ViewExecutableTest::assertViewDestroy in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::assertViewDestroy()
Asserts that expected view properties have been unset by destroy().
Parameters
\Drupal\views\ViewExecutable $view:
1 call to ViewExecutableTest::assertViewDestroy()
- ViewExecutableTest::testDestroy in core/
modules/ views/ tests/ src/ Kernel/ ViewExecutableTest.php - Tests the deconstructor to be sure that necessary objects are removed.
File
- core/
modules/ views/ tests/ src/ Kernel/ ViewExecutableTest.php, line 365
Class
- ViewExecutableTest
- Tests the ViewExecutable class.
Namespace
Drupal\Tests\views\KernelCode
protected function assertViewDestroy(ViewExecutable $view) {
$reflection = new \ReflectionClass($view);
$defaults = $reflection
->getDefaultProperties();
// The storage and user should remain.
unset($defaults['storage'], $defaults['user'], $defaults['request'], $defaults['routeProvider'], $defaults['viewsData']);
foreach ($defaults as $property => $default) {
$this
->assertSame($this
->getProtectedProperty($view, $property), $default);
}
}