You are here

public function MediaSourceFileTest::testPreventSourceFieldDeletion in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Functional/MediaSourceFileTest.php \Drupal\Tests\media\Functional\MediaSourceFileTest::testPreventSourceFieldDeletion()
  2. 9 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\Functional

Code

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);
}