Skip to content

Conversation

@terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Oct 22, 2025

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

Now the test runs correctly and is skipped, and exceptions are tested.

5) yiiunit\framework\db\oci\QueryBuilderTest::testAddDropDefaultValue with data set "drop" ('ALTER TABLE {{T_constraints_1...ault]]', Closure Object (...))
Adding/dropping default constraints is not supported in Oracle.

/home/runner/work/yii2/yii2/tests/framework/db/oci/QueryBuilderTest.php:92
phpvfscomposer:///home/runner/work/yii2/yii2/vendor/phpunit/phpunit/phpunit:106
/home/runner/work/yii2/yii2/vendor/bin/phpunit:118

6) yiiunit\framework\db\oci\QueryBuilderTest::testAddDropDefaultValue with data set "add" ('ALTER TABLE {{T_constraints_1...ault]]', Closure Object (...))
Adding/dropping default constraints is not supported in Oracle.

/home/runner/work/yii2/yii2/tests/framework/db/oci/QueryBuilderTest.php:92
phpvfscomposer:///home/runner/work/yii2/yii2/vendor/phpunit/phpunit/phpunit:106
/home/runner/work/yii2/yii2/vendor/bin/phpunit:118

7) yiiunit\framework\db\oci\QueryBuilderTest::testBuildLikeCondition
Test for yiiunit\framework\db\oci\QueryBuilderTest::testBuildLikeCondition skipped by data provider
PHPUnit\Framework\SkippedTestError: Could not execute Connection::quoteValue() method: Connection::dsn cannot be empty.
/home/runner/work/yii2/yii2/tests/framework/db/oci/QueryBuilderTest.php:146
phpvfscomposer:///home/runner/work/yii2/yii2/vendor/phpunit/phpunit/phpunit:106
/home/runner/work/yii2/yii2/vendor/bin/phpunit:118

phpvfscomposer:///home/runner/work/yii2/yii2/vendor/phpunit/phpunit/phpunit:106
/home/runner/work/yii2/yii2/vendor/bin/phpunit:118

@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 16:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors test data providers in the QueryBuilderTest class hierarchy by making them static and adding explicit array return type declarations. The changes remove the obsolete DbHelper class and its quote replacement functionality, integrating quote replacement directly into the test methods instead of data providers.

Key Changes:

  • Converted non-static data provider methods to static with array return types
  • Removed DbHelper::replaceQuotes() usage from data providers
  • Replaced methods that skipped tests with proper test methods that expect NotSupportedException

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/framework/support/DbHelper.php Deleted the entire DbHelper class containing the replaceQuotes utility method
tests/framework/db/sqlite/QueryBuilderTest.php Made data providers static, removed DbHelper usage, replaced skip methods with exception-expecting tests
tests/framework/db/pgsql/QueryBuilderTest.php Made data providers static, removed DbHelper usage, replaced skip method with exception-expecting test
tests/framework/db/oci/QueryBuilderTest.php Made data providers static, removed DbHelper usage, refactored test methods
tests/framework/db/mysql/QueryBuilderTest.php Made data providers static, removed DbHelper usage, replaced skip method with exception-expecting test
tests/framework/db/mssql/QueryBuilderTest.php Made data providers static, removed DbHelper usage, removed replaceQuotes calls from data
tests/framework/db/cubrid/QueryBuilderTest.php Made data providers static, replaced skip methods with exception-expecting tests
tests/framework/db/QueryBuilderTest.php Made data providers static, moved replaceQuotes logic from providers to test methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant