Loading core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php +6 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ protected function setUp(): void { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Attach a file field to the node type. $field_settings = ['file_extensions' => 'txt']; $field_settings = ['file_extensions' => 'bin txt']; $this->createFileField('field_file', 'node', 'article', [], $field_settings); // Log in as a content author who can create Articles. Loading Loading @@ -100,7 +100,11 @@ public function testUploadFileExceedingMaximumFileSize() { // Create a test file that exceeds the maximum POST size with 1 kilobyte. $post_max_size = Bytes::toNumber(ini_get('post_max_size')); $invalid_file = $this->generateFile('exceeding_post_max_size', ceil(($post_max_size + 1024) / 1024), 1024); $invalid_file = 'public://exceeding_post_max_size.bin'; $file = fopen($invalid_file, 'wb'); fseek($file, $post_max_size + 1024); fwrite($file, 0x0); fclose($file); // Go to the node creation form and try to upload the test file. $this->drupalGet('node/add/article'); Loading Loading
core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php +6 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ protected function setUp(): void { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Attach a file field to the node type. $field_settings = ['file_extensions' => 'txt']; $field_settings = ['file_extensions' => 'bin txt']; $this->createFileField('field_file', 'node', 'article', [], $field_settings); // Log in as a content author who can create Articles. Loading Loading @@ -100,7 +100,11 @@ public function testUploadFileExceedingMaximumFileSize() { // Create a test file that exceeds the maximum POST size with 1 kilobyte. $post_max_size = Bytes::toNumber(ini_get('post_max_size')); $invalid_file = $this->generateFile('exceeding_post_max_size', ceil(($post_max_size + 1024) / 1024), 1024); $invalid_file = 'public://exceeding_post_max_size.bin'; $file = fopen($invalid_file, 'wb'); fseek($file, $post_max_size + 1024); fwrite($file, 0x0); fclose($file); // Go to the node creation form and try to upload the test file. $this->drupalGet('node/add/article'); Loading