minor #31115 [Form] Workaround for \DateInterval::createFromDateString() (renanbr)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Workaround for \DateInterval::createFromDateString()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This patch makes test `Symfony\Component\Form\Tests\Extension\Core\Type\DateIntervalTypeTest::testSubmitNullUsesDateEmptyData()` pass in PHP 7.2.17 and 7.3.4

PHP bug reference : https://bugs.php.net/bug.php?id=77896

See also : https://3v4l.org/sQjh2

Commits
-------

54247ec05f Workaround for \DateInterval::createFromDateString()
This commit is contained in:
Nicolas Grekas 2019-04-15 15:32:17 +02:00
commit 81d11c3f2e
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,7 @@ class DateIntervalTypeTest extends BaseTypeTest
public function provideEmptyData()
{
$expectedData = \DateInterval::createFromDateString('6 years and 4 months');
$expectedData = new \DateInterval('P6Y4M');
return [
'Simple field' => ['single_text', 'P6Y4M0D', $expectedData],