Skip to content

Commit 361a133

Browse files
committed
minor #42630 [Form] Remove broken test case (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [Form] Remove broken test case | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Part of #41552 | License | MIT | Doc PR | N/A If we try to parse a `DateTime` object solely from a day of year, like this… ```php $date = \DateTime::createFromFormat('z', '33'); ``` … PHP 8.1 will refuse to do that with the error message > A 'day of year' can only come after a year has been found The commit that caused this was php/php-src@8426623 by `@derickr`. Our `DateTimeToStringTransformerTest` tests if that kind of transformation works, but I doubt that this covers an actual use case. This is why I propose to simply remove the failing test case. Commits ------- ee614c3d30 Remove broken test case
2 parents 33272a8 + 527334a commit 361a133

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
class DateTimeToStringTransformerTest extends TestCase
1919
{
20-
public function dataProvider()
20+
public function dataProvider(): array
2121
{
22-
$data = [
22+
return [
2323
['Y-m-d H:i:s', '2010-02-03 16:05:06', '2010-02-03 16:05:06 UTC'],
2424
['Y-m-d H:i:00', '2010-02-03 16:05:00', '2010-02-03 16:05:00 UTC'],
2525
['Y-m-d H:i', '2010-02-03 16:05', '2010-02-03 16:05:00 UTC'],
@@ -36,7 +36,6 @@ public function dataProvider()
3636

3737
// different day representations
3838
['Y-m-j', '2010-02-3', '2010-02-03 00:00:00 UTC'],
39-
['z', '33', '1970-02-03 00:00:00 UTC'],
4039

4140
// not bijective
4241
// this will not work as PHP will use actual date to replace missing info
@@ -63,8 +62,6 @@ public function dataProvider()
6362

6463
['Y-z', '2010-33', '2010-02-03 00:00:00 UTC'],
6564
];
66-
67-
return $data;
6865
}
6966

7067
/**

0 commit comments

Comments
 (0)