diff --git a/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php b/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php index 1a1a24e2b278..16d4045e6d58 100644 --- a/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php @@ -285,6 +285,26 @@ public function testSubmitMultipleFiles($method) $this->assertSame($file, $form->getData()); } + /** + * @dataProvider methodExceptGetProvider + */ + public function testSubmitFileWithNamelessForm($method) + { + $form = $this->createForm('', $method, true); + $fileForm = $this->createBuilder('document', false, ['allow_file_upload' => true])->getForm(); + $form->add($fileForm); + $file = $this->getUploadedFile(); + $this->setRequestData($method, [ + 'document' => null, + ], [ + 'document' => $file, + ]); + $this->requestHandler->handleRequest($form, $this->request); + + $this->assertTrue($form->isSubmitted()); + $this->assertSame($file, $fileForm->getData()); + } + /** * @dataProvider getPostMaxSizeFixtures */