Skip to content

Commit

Permalink
minor #30132 [Form] add back test after fixing it (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] add back test after fixing it

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29934 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

0daeba8 add back test after fixing it
  • Loading branch information
fabpot committed Feb 12, 2019
2 parents d4ed49b + 0daeba8 commit a205211
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php
Expand Up @@ -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
*/
Expand Down

0 comments on commit a205211

Please sign in to comment.