-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[3.0] Fix tests #15664
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
[3.0] Fix tests #15664
Conversation
} | ||
|
||
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, new \DateTimeZone('GMT+03:00'), IntlDateFormatter::GREGORIAN, 'zzzz'); | ||
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, new \DateTimeZone('GMT'), IntlDateFormatter::GREGORIAN, 'zzzz'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @stof was there a specific reason to test with 'GMT+03:00' here? Because it doesn't work on 5.5.9 (only on 5.5.10+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, the goal was to ensure that this syntax was supported when converting DateTimeZone to Intl timezone ids (there is a specific handling for them).
We might add another test using GMT only and keep the test with GMT+03:00
but skipping it in versions not supporting it.
Btw, this should be done in 2.3+ if we go this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, given the test failure, it looks like we have an issue with the support of GMT
in the stub code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the change and skipped the test on 5.5.9. We should open a PR on 2.3 now.
a410475
to
ea9bb00
Compare
@@ -47,11 +46,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest | |||
*/ | |||
protected $repository; | |||
|
|||
protected function getApiVersion() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoudln't this be kept for lowest deps (which would use the 2.x validator component) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the change, it's not related to this pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be great to send a separate PR with this cleanup as you have it though
@@ -87,9 +87,6 @@ public function provideInvalidComparisons() | |||
array($object, '2', $object, '2', __NAMESPACE__.'\ComparisonTest_Class'), | |||
); | |||
|
|||
$immutableDate = new \DateTimeImmutable('2000-01-01'); | |||
$comparisons[] = array($immutableDate, 'Jan 1, 2000, 12:00 AM', $immutableDate, 'Jan 1, 2000, 12:00 AM', 'DateTime'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's wrong, and already tested thanks to https://github.com/nicolas-grekas/symfony/blob/m-fx/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php#L37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I was not aware of this nice trick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be done in older branches though ?
4a306a4
to
e57957d
Compare
PR is ready to merge. I can't reproduce the failures on the doctrine bridge with a fresh php7. |
5134553
to
81afe81
Compare
Upgrading to doctrine/orm ^2.4.6 as lowest version fixes the remaining test failures. |
@@ -17,7 +17,7 @@ | |||
], | |||
"require": { | |||
"php": ">=5.5.9", | |||
"doctrine/common": "~2.3", | |||
"doctrine/common": "~2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if these changes fix tests for php 7, should they not be done on symfony 2.3 or 2.7/2.8 instead? I assume they would fail there as well since 3.0 doesn't have anything new yet, afaik.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm totally fine with bumping the Doctrine base versions btw. 2.2 and 2.3 are long EOLed.
@@ -855,6 +855,10 @@ private function getInt64Value($value) | |||
return false; | |||
} | |||
|
|||
if (PHP_INT_SIZE !== 8 && ($value > self::$int32Range['positive'] || $value < self::$int32Range['negative'])) { | |||
return (float) $value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the phpdoc needs to be updated though, as it says it returns int|false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #15672
Reverted the doctrine upgrade: that was a temporary bug in php7 |
038d348
to
03f08c4
Compare
This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0] Fix tests | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Should make tests green again on travis and appveyor Commits ------- 37e1f1a [3.0] Fix tests
Should make tests green again on travis and appveyor