public function ViewsEntitySchemaSubscriberIntegrationTest::testBrokenView in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::testBrokenView()
- 10 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::testBrokenView()
Tests that broken views are handled gracefully.
File
- core/
modules/ views/ tests/ src/ Kernel/ EventSubscriber/ ViewsEntitySchemaSubscriberIntegrationTest.php, line 512
Class
- ViewsEntitySchemaSubscriberIntegrationTest
- Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber.
Namespace
Drupal\Tests\views\Kernel\EventSubscriberCode
public function testBrokenView() {
$view_id = 'test_view_entity_test';
$this->state
->set('views_test_config.broken_view', $view_id);
$this
->updateEntityTypeToTranslatable(TRUE);
/** @var \Drupal\views\Entity\View $view */
$entity_storage = $this->entityTypeManager
->getStorage('view');
$view = $entity_storage
->load($view_id);
// The broken handler should have been removed.
$display = $view
->getDisplay('default');
$this
->assertFalse(isset($display['display_options']['fields']['id_broken']));
$this
->assertUpdatedViews([
$view_id,
]);
}