$this->
assertSession()->
pageTextContains('The "invalid" plugin does not exist.'
);
$this->
assertSession()->
elementNotExists('xpath', "//div[@id = 'block-{
$block->
id()}']"
);
} /**
* Tests display validation when a required relationship is missing.
*/
public function testMissingRelationship() { $view = Views::
getView('test_exposed_relationship_admin_ui'
);
// Remove the relationship that is not used by other handlers.
$view->
removeHandler('default', 'relationship', 'uid_1'
);
$errors =
$view->
validate();
// Check that no error message is shown.
$this->
assertArrayNotHasKey('default',
$errors, 'No errors found when removing unused relationship.'
);
// Unset cached relationships (see DisplayPluginBase::getHandlers())
unset($view->display_handler->handlers
['relationship'
]);
// Remove the relationship used by other handlers.
$view->
removeHandler('default', 'relationship', 'uid'
);
// Validate display
$errors =
$view->
validate();