Repository navigation
Override the date type in EntityColumnRuleTest for every data set - #798
Open
SanderMuller wants to merge 1 commit into
Open
SanderMuller wants to merge 1 commit into
SanderMuller wants to merge 1 commit into
Conversation
entity-manager.php overrides the Doctrine date type for the whole process. The data sets without an object manager expect that override, but they only get it when a test that loads entity-manager.php ran before them. With the random test order, testRuleWithAllowedNullableProperty reported an extra error for MyBrokenEntity::$six when its data set phpstan#1 ran before data set #0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
The red jobs are not from this change. Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EntityColumnRuleTest::testRuleWithAllowedNullablePropertyfails when its data set #1 (no object manager) runs before data set #0 (entity-manager.php). It reports an extra error:entity-manager.phpcallsType::overrideType('date', DateTimeImmutableType::class)for the whole process. The expected errors of the data sets without an object manager assume that override. These data sets only get it when a test that loadsentity-manager.phpran before them. WithexecutionOrder="random", that depends on the seed. This change sets the same override ingetRule(), so every data set starts with the same type.I saw the failure in the extension tests of phpstan/phpstan-src#6733 (seed 1791793640). I ran the test alone with seeds 1 to 8. Before this change, it failed for the 5 seeds that run data set #1 first. After the change, it passed for all 8.
🤖 Generated with Claude Code