Skip to content

Don't partially mock the AbstractPlatform class#12114

Merged
derrabus merged 1 commit intodoctrine:3.5.xfrom
derrabus:chore/dont-mock-platform
Aug 6, 2025
Merged

Don't partially mock the AbstractPlatform class#12114
derrabus merged 1 commit intodoctrine:3.5.xfrom
derrabus:chore/dont-mock-platform

Conversation

@derrabus
Copy link
Copy Markdown
Member

@derrabus derrabus commented Aug 6, 2025

In DBAL 5 is has become harder to mock the AbstractPlatform class because of its protected constructor. In addition to this, PHPUnit has deprecated the getMockForAbstractClass() that we've used for that purpose (sebastianbergmann/phpunit#5241).

I think, I'll be easier for us if used actual platform classes instead. In this PR, I'm defaulting to SQLitePlatform. For some tests that tested SQL code generation, I've switched to different platforms if the test did not expect the SQLite flavor of the generated SQL.

@derrabus derrabus added this to the 3.5.2 milestone Aug 6, 2025
@derrabus derrabus requested review from greg0ire and morozov August 6, 2025 14:42
@derrabus derrabus force-pushed the chore/dont-mock-platform branch from ef0b9b6 to 38aea98 Compare August 6, 2025 14:43
@derrabus derrabus merged commit 66e0e92 into doctrine:3.5.x Aug 6, 2025
83 checks passed
@derrabus derrabus deleted the chore/dont-mock-platform branch August 6, 2025 16:12
derrabus added a commit to derrabus/orm that referenced this pull request Aug 6, 2025
* 3.5.x:
  Don't partially mock the AbstractPlatform class (doctrine#12114)
derrabus added a commit to derrabus/orm that referenced this pull request Aug 6, 2025
* 3.6.x:
  Don't partially mock the AbstractPlatform class (doctrine#12114)
derrabus added a commit to derrabus/orm that referenced this pull request Aug 6, 2025
* 3.6.x:
  Don't partially mock the AbstractPlatform class (doctrine#12114)
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.

2 participants