// 2. Even though `sourceEditing` may not be enabled before this update, it
// must be after, at least if image uploads are disabled: extra mark-up will
// be added to its configuration to avoid breaking backwards compatibility.
if (!
$image_uploads_are_enabled) { if (!
$source_editing_is_already_enabled) { $this->
assertNotContains('sourceEditing',
$editor_before->
getSettings()['toolbar'
]['items'
]);
} $this->
assertContains('sourceEditing',
$editor_after->
getSettings()['toolbar'
]['items'
]);
$source_editing_before =
$source_editing_is_already_enabled ?
static::
getSourceEditingRestrictions($editor_before) : HTMLRestrictions::
emptySet();
$source_editing_after =
static::
getSourceEditingRestrictions($editor_after);
if ($source_editing_is_already_enabled) { // Nothing has been removed from the allowed source editing tags.
$this->
assertFalse($source_editing_before->
allowsNothing());
$this->
assertTrue($source_editing_before->
diff($source_editing_after) ->
allowsNothing());
} $this->
assertSame($expected_source_editing_additions,
$source_editing_after->
diff($source_editing_before) ->
toCKEditor5ElementsArray());
}