Skip to content

Commit

Permalink
minor #31115 [Form] Workaround for \DateInterval::createFromDateStrin…
Browse files Browse the repository at this point in the history
…g() (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()
  • Loading branch information
nicolas-grekas committed Apr 15, 2019
2 parents 3fdc359 + 54247ec commit 81d11c3
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -442,7 +442,7 @@ public function testSubmitNullUsesDateEmptyData($widget, $emptyData, $expectedDa

public function provideEmptyData()
{
$expectedData = \DateInterval::createFromDateString('6 years and 4 months');
$expectedData = new \DateInterval('P6Y4M');

return [
'Simple field' => ['single_text', 'P6Y4M0D', $expectedData],
Expand Down

0 comments on commit 81d11c3

Please sign in to comment.