Skip to content

[4.x] Run the database-independent query tests in the unit suite - #408

Open
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-query-tests-in-unit-suite
Open

Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-query-tests-in-unit-suite

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Tests/{Mysql,Mysqli,Pgsql,Sqlite,Sqlsrv}/*QueryTest.php test the driver-specific query builders against a stubbed DatabaseInterface and need no database, but they only ran in the driver configurations (phpunit.pgsql.xml.dist etc.). A plain vendor/bin/phpunit therefore did not run them, which is how the broken PgsqlQuery::forUpdate()/limit() went unnoticed. The five files are now listed in the unit suite of phpunit.xml.dist: a plain run goes from 144 to 197 tests. They stay where they are, so the driver configurations still run them too.

The other half of the review item (regression tests for the individual bugs) is part of the fix PRs, most of them in AbstractDatabaseDriverTestCase so they run for every driver.

Note for #374: that PR copies the unit-suite list into phpunit.sqlite.xml.dist and phpunit.mysqli.xml.dist. Whichever is merged second should add these five files there too (and may then drop the duplicate run of the SQLite/MySQLi query test from the driver suite).

Testing Instructions

vendor/bin/phpunit runs 197 tests instead of 144, all passing.

Documentation Changes Required

None.

🤖 Generated with Claude Code

The MySQL, MySQLi, PostgreSQL, SQLite and SQL Server query builder tests use
a stubbed driver and need no server, but they lived in the driver
directories and only ran in the driver-specific configurations, so a plain
phpunit run skipped them. They are now part of the unit suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant