public function MediaSourceFileTest::testPreventSourceFieldDeletion in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/MediaSourceFileTest.php \Drupal\Tests\media\Functional\MediaSourceFileTest::testPreventSourceFieldDeletion()
- 10 core/modules/media/tests/src/Functional/MediaSourceFileTest.php \Drupal\Tests\media\Functional\MediaSourceFileTest::testPreventSourceFieldDeletion()
Ensure source field deletion is not possible.
File
- core/
modules/ media/ tests/ src/ Functional/ MediaSourceFileTest.php, line 50
Class
- MediaSourceFileTest
- Tests the file media source.
Namespace
Drupal\Tests\media\FunctionalCode
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);
}