reverted: --- b/core/modules/file/src/Tests/FileManagedFileElementTest.php +++ a/core/modules/file/src/Tests/FileManagedFileElementTest.php @@ -6,9 +6,6 @@ */ namespace Drupal\file\Tests; -use Drupal\Component\Utility\Bytes; -use Drupal\Component\Utility\SafeMarkup; -use Drupal\file\Entity\File; /** * Tests the 'managed_file' element type. @@ -18,18 +15,6 @@ * that aren't related to fields into it. */ class FileManagedFileElementTest extends FileFieldTestBase { - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Setup the max filesize to be the same as the post max size, so we can - // post a file which let's PHP to exceed its post max size. - ini_set('upload_max_filesize', ini_get('post_max_size')); - } - /** * Tests the managed_file element type. */ @@ -121,28 +106,6 @@ $this->drupalPostForm(NULL, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => '')), 'Submission after file upload and removal was successful.'); - - // Upload a file which exceeds the configured post_max_size limit. - $post_max_size_ini = ini_get('post_max_size'); - if ($post_max_size_ini) { - $post_max_size = Bytes::toInt($post_max_size_ini); - $big_test_data = str_repeat('a', $post_max_size * 1.1); - file_put_contents('public://test.dat', $big_test_data); - - /** @var \Drupal\Core\File\FileSystemInterface $file_system */ - $file_system = \Drupal::service('file_system'); - $edit = array($file_field_name => $file_system->realpath('public://test.dat')); - if ($ajax) { - $this->drupalPostAjaxForm(NULL, $edit, $input_base_name . '_upload_button'); - $this->assertText(SafeMarkup::format('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@post_max_size) that this server supports.', ['@post_max_size' => format_size(file_upload_max_size())])); - } - else { - // @todo Currently the post request just fails, as there is no - // input, so I guess we can't protect against it? This would - // be odd. - $this->drupalPostForm(NULL, $edit, t('Upload')); - } - } } } }