You are here

public function FileFieldFileExtensionsUpdateTest::testInsecureUpdatesNotAllowed in Drupal 9

Tests adding txt extension to field that allow insecure extensions.

File

core/modules/file/tests/src/Functional/Update/FileFieldFileExtensionsUpdateTest.php, line 34

Class

FileFieldFileExtensionsUpdateTest
Tests file_post_update_add_txt_if_allows_insecure_extensions().

Namespace

Drupal\Tests\file\Functional\Update

Code

public function testInsecureUpdatesNotAllowed() {
  $this
    ->setAllowedExtensions('php jpg');
  $this
    ->runUpdates();
  $this
    ->assertSession()
    ->statusCodeEquals('200');
  $field = FieldConfig::load('node.article.field_image');
  $this
    ->assertSame('php jpg txt', $field
    ->getSetting('file_extensions'));
}