Skip to content

Fix tests failing with DBAL 3 #42819

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
Sep 1, 2021
Merged

Conversation

derrabus
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Doctrine ORM is not blocking the installation of DBAL 3 anymore. This has revealed a few tests that were not fully compatible with DBAL 3. This PR is an attempt to fix them.

@derrabus derrabus requested a review from sroze as a code owner August 31, 2021 22:14
@carsonbot carsonbot added this to the 4.4 milestone Aug 31, 2021
@derrabus
Copy link
Member Author

I'd prefer to ignore fabbot's suggestion if that's okay.

@derrabus derrabus force-pushed the bugfix/doctrine-tests branch from d3072e6 to 45b011e Compare August 31, 2021 23:16
$stmt = $this->getConnection()->prepare($sql);
$stmt->bindValue($i = 1, $now, \PDO::PARAM_INT);
$stmt = $connection->prepare($sql);
$stmt->bindValue($i = 1, $now, $useDbalConstants ? ParameterType::INTEGER : \PDO::PARAM_INT);
Copy link
Member Author

Choose a reason for hiding this comment

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

Using the PDO constants on a DBAL 3 connection will break in PHP 8.1 because PDO changed the values of those constants. 😱

@derrabus derrabus force-pushed the bugfix/doctrine-tests branch from 45b011e to 5ee3ad4 Compare August 31, 2021 23:32
@derrabus derrabus force-pushed the bugfix/doctrine-tests branch 2 times, most recently from 23f9649 to 784d948 Compare September 1, 2021 10:43
@fabpot fabpot force-pushed the bugfix/doctrine-tests branch from 784d948 to 3ce1f76 Compare September 1, 2021 12:46
@fabpot
Copy link
Member

fabpot commented Sep 1, 2021

Thank you @derrabus.

@fabpot fabpot merged commit 1b496a0 into symfony:4.4 Sep 1, 2021
@derrabus derrabus deleted the bugfix/doctrine-tests branch September 1, 2021 12:56
This was referenced Sep 28, 2021
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.

6 participants