function FileFieldFileExtensionsUpdateTest::testInsecureUpdatesNotAllowed

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.