8000 [HttpKernel] Fix timezone influenced tests by GromNaN · Pull Request #45859 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Fix timezone influenced tests #45859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

GromNaN
Copy link
Member
@GromNaN GromNaN commented Mar 26, 2022
Q A
Branch? 6.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets #45589 (comment)
License MIT
Doc PR -

DateTimeValueResolverTest fails depending on the default timezone and the current time.

The culprit is the combinaison of strtotime + new DateTime.

} elseif (false !== $timestamp = strtotime($value)) {
$date = new $class('@'.$timestamp);
}

There were 3 failures:

1) Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver\DateTimeValueResolverTest::testFullDate
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2012-07-21'
+'2012-07-20'

/home/runner/work/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php:53

2) Symfony\Component\Http
8000
Kernel\Tests\Controller\ArgumentResolver\DateTimeValueResolverTest::testCustomClass
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2016-09-08'
+'2016-09-07'

/home/runner/work/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php:100

3) Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver\DateTimeValueResolverTest::testDateTimeImmutable
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2016-09-08'
+'2016-09-07'

/home/runner/work/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php:116

@GromNaN GromNaN added this to the 6.1 milestone Mar 26, 2022
@carsonbot carsonbot changed the title Fix timezone influenced tests [HttpKernel] Fix timezone influenced tests Mar 26, 2022
@GromNaN GromNaN force-pushed the fix-tests-timezone branch 2 times, most recently from 40981b7 to 215d9ff Compare March 26, 2022 23:15
@GromNaN GromNaN force-pushed the fix-tests-timezone branch from 215d9ff to 9a0e99c Compare March 27, 2022 07:54
@codedmonkey
Copy link
Contributor

Sorry about that, I wasn't clear in my PR and my initial fix was insufficient so I rolled it back.

@fabpot
Copy link
Member
fabpot commented Mar 27, 2022

Thank you @GromNaN.

@fabpot fabpot merged commit 26c1d4b into symfony:6.1 Mar 27, 2022
@GromNaN GromNaN deleted the fix-tests-timezone branch March 27, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0