-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
@@ -113,6 +114,7 @@ public function testDatabaseUrlPrimaryReplica(): void | |||
'wrapperClass' => PrimaryReadReplicaConnection::class, | |||
]; | |||
|
|||
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/dbal/pull/5843'); |
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.
URLs for primary/replica have to be parsed in advance as well, so we do get the deprecation here.
if (isset($url['driverClass'])) { | ||
self::markTestSkipped( | ||
'Legacy test case: Merging driverClass into the parsed parameters has to be done in userland now.', | ||
); | ||
} |
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.
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']); |
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 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. 😓
Summary
This PR fixes some issues with the tests I've overlooked. I'll get into details by commenting on the diff.