// The untrusted user tries to edit content that is written in a text format
// that they are not allowed to use. The editor is still loaded. CKEditor,
// for example, supports being loaded in a disabled state.
$this->
drupalGet('node/1/edit'
);
[,
$editor_settings_present,
$editor_js_present,
$body] =
$this->
getThingsToCheck('body'
);
$this->
assertTrue($editor_settings_present, 'Text Editor module settings.'
);
$this->
assertTrue($editor_js_present, 'Text Editor JavaScript.'
);
$this->
assertSession()->
elementsCount('xpath',
$body, 1
);
$this->
assertSession()->
fieldDisabled("edit-body-0-value"
);
$this->
assertSession()->
fieldValueEquals("edit-body-0-value", 'This field has been disabled because you do not have sufficient permissions to edit it.'
);
$this->
assertSession()->
elementNotExists('css', 'select.js-filter-list'
);
// Verify that no single text format hidden input exists on the page.
$this->
assertSession()->
elementNotExists('xpath', '//input[@type="hidden" and contains(@class, "editor")]'
);
} /**
* Tests supported element types.
*/
public function testSupportedElementTypes() { // Associate the unicorn text editor with the "Full HTML" text format.
$editor = Editor::
create([