// so no menu rebuild was executed (so the path is still available).
$config =
$this->
config('views.view.test_display_invalid'
);
$config->
set('display.page_1.display_plugin', 'invalid'
);
$config->
save();
$this->
drupalGet('test_display_invalid'
);
$this->
assertSession()->
statusCodeEquals(200
);
$this->
assertSession()->
pageTextContains('The "invalid" plugin does not exist.'
);
// Rebuild the router, and ensure that the path is not accessible anymore.
views_invalidate_cache();
\Drupal::
service('router.builder'
)->
rebuildIfNeeded();
$this->
drupalGet('test_display_invalid'
);
$this->
assertSession()->
statusCodeEquals(404
);
// Change the display plugin ID back to the correct ID.
$config =
$this->
config('views.view.test_display_invalid'
);
$config->
set('display.page_1.display_plugin', 'page'
);
$config->
save();
// Place the block display.
$block =
$this->
drupalPlaceBlock('views_block:test_display_invalid-block_1',
['label' => 'Invalid display'
]);