Issue #2895581 by chr.fritsch, Wim Leers: Add test coverage ensuring that the media source field cannot be removed from a media type
parent
7da31e1eae
commit
337963d193
|
@ -51,4 +51,15 @@ class MediaSourceFileTest extends MediaFunctionalTestBase {
|
|||
$this->assertSame('txt doc docx pdf odt', FieldConfig::load("media.$media_type_id.field_media_file")->get('settings')['file_extensions']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure source field deletion is not possible.
|
||||
*/
|
||||
public function testPreventSourceFieldDeletion() {
|
||||
$media_type = $this->createMediaType([], 'file');
|
||||
$media_type_id = $media_type->id();
|
||||
|
||||
$this->drupalGet("admin/structure/media/manage/$media_type_id/fields/media.$media_type_id.field_media_file/delete");
|
||||
$this->assertSession()->statusCodeEquals(403);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue