Skip to content
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

Fix test cases for URL parsing #5848

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

derrabus
Copy link
Member

Q A
Type bug
Fixed issues Follow-up to #5843

Summary

This PR fixes some issues with the tests I've overlooked. I'll get into details by commenting on the diff.

@derrabus derrabus added this to the 3.6.0 milestone Dec 31, 2022
@@ -113,6 +114,7 @@ public function testDatabaseUrlPrimaryReplica(): void
'wrapperClass' => PrimaryReadReplicaConnection::class,
];

$this->expectDeprecationWithIdentifier('https://github.com/doctrine/dbal/pull/5843');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URLs for primary/replica have to be parsed in advance as well, so we do get the deprecation here.

Comment on lines +188 to +192
if (isset($url['driverClass'])) {
self::markTestSkipped(
'Legacy test case: Merging driverClass into the parsed parameters has to be done in userland now.',
);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently remove an explicitly configured driver class if the URL has a scheme. That might be unexpected because for all other parameters, it works the other way round. Since with the new parser, the app is in charge of that, we need to skip the corresponding tests.

['url' => $url] = $options = $url;
unset($options['url']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I don't unset the URL here, it's actually parsed twice which is why the driverClass tests still worked although they shouldn't have. 😓

@derrabus derrabus merged commit 186a3fb into doctrine:3.6.x Dec 31, 2022
@derrabus derrabus deleted the bugfix/driver-manager-test branch December 31, 2022 13:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants