Skip to content

Commit 81d11c3

Browse files
minor symfony#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 ------- 54247ec Workaround for \DateInterval::createFromDateString()
2 parents 3fdc359 + 54247ec commit 81d11c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateIntervalTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function testSubmitNullUsesDateEmptyData($widget, $emptyData, $expectedDa
442442

443443
public function provideEmptyData()
444444
{
445-
$expectedData = \DateInterval::createFromDateString('6 years and 4 months');
445+
$expectedData = new \DateInterval('P6Y4M');
446446

447447
return [
448448
'Simple field' => ['single_text', 'P6Y4M0D', $expectedData],

0 commit comments

Comments
 (0)