diff --git a/core/modules/file/src/Tests/FileManagedFileElementTest.php b/core/modules/file/src/Tests/FileManagedFileElementTest.php index 0de2ded..5740509 100644 --- a/core/modules/file/src/Tests/FileManagedFileElementTest.php +++ b/core/modules/file/src/Tests/FileManagedFileElementTest.php @@ -18,6 +18,18 @@ * 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. */ @@ -113,8 +125,6 @@ function testManagedFile() { // 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) { - $this->assertTrue(FALSE, ini_get('post_max_size')); - $this->assertTrue(FALSE, ini_get('upload_max_filesize')); $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);