diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index ad5011082f..11e8f3f70b 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -114,7 +114,6 @@
{{- form_label(form) }} {# -#} {{ form_widget(form, widget_attr) }} {# -#} - {{ form_widget(form) }} {# -#} {{ form_errors(form) }} {# -#}
{# -#} {%- endblock form_row %} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index 400f994d2f..cf44257d34 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -68,7 +68,7 @@ class TranslationDebugCommandTest extends TestCase /** * @group legacy * @expectedDeprecation Storing translations in the "%ssf_translation%s/Resources/translations" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/translations" directory instead. - * @expectedDeprecation Storing templates in the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead. + * @expectedDeprecation Loading Twig templates from the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead. */ public function testDebugLegacyDefaultDirectory() { diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php index bff93d478e..311529c294 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php @@ -199,11 +199,12 @@ class FileTypeTest extends BaseTypeTest */ public function testFailedFileUploadIsTurnedIntoFormErrorUsingHttpFoundationRequestHandler($errorCode, $expectedErrorMessage) { + $requestHandler = new HttpFoundationRequestHandler(); $form = $this->factory ->createBuilder(static::TESTED_TYPE) - ->setRequestHandler(new HttpFoundationRequestHandler()) + ->setRequestHandler($requestHandler) ->getForm(); - $form->submit(new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'foo', null, null, $errorCode, true)); + $form->submit($this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'foo', $errorCode)); if (UPLOAD_ERR_OK === $errorCode) { $this->assertTrue($form->isValid()); @@ -243,15 +244,16 @@ class FileTypeTest extends BaseTypeTest */ public function testMultipleSubmittedFailedFileUploadsAreTurnedIntoFormErrorUsingHttpFoundationRequestHandler($errorCode, $expectedErrorMessage) { + $requestHandler = new HttpFoundationRequestHandler(); $form = $this->factory ->createBuilder(static::TESTED_TYPE, null, [ 'multiple' => true, ]) - ->setRequestHandler(new HttpFoundationRequestHandler()) + ->setRequestHandler($requestHandler) ->getForm(); $form->submit([ - new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'foo', null, null, $errorCode, true), - new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'bar', null, null, $errorCode, true), + $this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'foo', $errorCode), + $this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'bar', $errorCode), ]); if (UPLOAD_ERR_OK === $errorCode) { @@ -316,15 +318,21 @@ class FileTypeTest extends BaseTypeTest ]; } - private function createUploadedFile(RequestHandlerInterface $requestHandler, $path, $originalName) + private function createUploadedFile(RequestHandlerInterface $requestHandler, $path, $originalName, $errorCode = 0) { if ($requestHandler instanceof HttpFoundationRequestHandler) { - return new UploadedFile($path, $originalName, null, null, true); + $class = new \ReflectionClass(UploadedFile::class); + + if (5 === $class->getConstructor()->getNumberOfParameters()) { + return new UploadedFile($path, $originalName, null, $errorCode, true); + } + + return new UploadedFile($path, $originalName, null, null, $errorCode, true); } return [ 'name' => $originalName, - 'error' => 0, + 'error' => $errorCode, 'type' => 'text/plain', 'tmp_name' => $path, 'size' => null, diff --git a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php index 0e5389568e..dc082505a1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php @@ -59,6 +59,12 @@ class HttpFoundationRequestHandlerTest extends AbstractRequestHandlerTest protected function getFailedUploadedFile($errorCode) { + $class = new \ReflectionClass(UploadedFile::class); + + if (5 === $class->getConstructor()->getNumberOfParameters()) { + return new UploadedFile(__DIR__.'/../../Fixtures/foo', 'foo', null, $errorCode, true); + } + return new UploadedFile(__DIR__.'/../../Fixtures/foo', 'foo', null, null, $errorCode, true); } }