Tests json functions in where queries#135
Merged
Hikariii merged 1 commit intoScientaNL:masterfrom Mar 6, 2026
Merged
Conversation
Coverage Report
|
alleknalle
approved these changes
Mar 6, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds testWhere methods to numerous existing JSON function test classes (both unit/query tests and integration tests) across MySQL, MariaDB, SQLite, PostgreSQL, and MSSQL platforms. Each new test verifies that the respective JSON function can be used in a DQL WHERE clause and produces the correct SQL output.
Changes:
- Added
testWhere()unit test methods to 28 query-level test files across all supported database platforms (MySQL, MariaDB, SQLite, PostgreSQL, MSSQL), verifying DQL-to-SQL translation when JSON functions are used in WHERE clauses. - Added
testFilterBy*()integration test methods to 8 integration test files (MySQL, MariaDB, MSSQL, PostgreSQL, SQLite), verifying end-to-end filtering with JSON functions against real (or mocked) databases.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Query/Functions/Sqlite/JsonValidTest.php | Added WHERE clause test for SQLite JSON_VALID |
| tests/Query/Functions/Sqlite/JsonTypeTest.php | Added WHERE clause test for SQLite JSON_TYPE |
| tests/Query/Functions/Sqlite/JsonSetTest.php | Added WHERE clause test for SQLite JSON_SET |
| tests/Query/Functions/Sqlite/JsonReplaceTest.php | Added WHERE clause test for SQLite JSON_REPLACE |
| tests/Query/Functions/Sqlite/JsonRemoveTest.php | Added WHERE clause test for SQLite JSON_REMOVE |
| tests/Query/Functions/Sqlite/JsonPatchTest.php | Added WHERE clause test for SQLite JSON_PATCH |
| tests/Query/Functions/Sqlite/JsonInsertTest.php | Added WHERE clause test for SQLite JSON_INSERT |
| tests/Query/Functions/Sqlite/JsonExtractTest.php | Added WHERE clause test for SQLite JSON_EXTRACT |
| tests/Query/Functions/Sqlite/JsonArrayLengthTest.php | Added WHERE clause test for SQLite JSON_ARRAY_LENGTH |
| tests/Query/Functions/Postgresql/JsonbInsertTest.php | Added WHERE clause test for PostgreSQL JSONB_INSERT |
| tests/Query/Functions/Mysql/JsonValueTest.php | Added WHERE clause test for MySQL JSON_VALUE |
| tests/Query/Functions/Mysql/JsonValidTest.php | Added WHERE clause test for MySQL JSON_VALID |
| tests/Query/Functions/Mysql/JsonUnquoteTest.php | Added WHERE clause test for MySQL JSON_UNQUOTE |
| tests/Query/Functions/Mysql/JsonTypeTest.php | Added WHERE clause test for MySQL JSON_TYPE |
| tests/Query/Functions/Mysql/JsonSetTest.php | Added WHERE clause test for MySQL JSON_SET |
| tests/Query/Functions/Mysql/JsonSearchTest.php | Added WHERE clause test for MySQL JSON_SEARCH |
| tests/Query/Functions/Mysql/JsonReplaceTest.php | Added WHERE clause test for MySQL JSON_REPLACE |
| tests/Query/Functions/Mysql/JsonRemoveTest.php | Added WHERE clause test for MySQL JSON_REMOVE |
| tests/Query/Functions/Mysql/JsonQuoteTest.php | Added WHERE clause test for MySQL JSON_QUOTE |
| tests/Query/Functions/Mysql/JsonPrettyTest.php | Added WHERE clause test for MySQL JSON_PRETTY |
| tests/Query/Functions/Mysql/JsonMergeTest.php | Added WHERE clause test for MySQL JSON_MERGE |
| tests/Query/Functions/Mysql/JsonMergePreserveTest.php | Added WHERE clause test for MySQL JSON_MERGE_PRESERVE |
| tests/Query/Functions/Mysql/JsonMergePatchTest.php | Added WHERE clause test for MySQL JSON_MERGE_PATCH |
| tests/Query/Functions/Mysql/JsonLengthTest.php | Added WHERE clause test for MySQL JSON_LENGTH |
| tests/Query/Functions/Mysql/JsonKeysTest.php | Added WHERE clause test for MySQL JSON_KEYS |
| tests/Query/Functions/Mysql/JsonInsertTest.php | Added WHERE clause test for MySQL JSON_INSERT |
| tests/Query/Functions/Mysql/JsonExctractTest.php | Added WHERE clause test for MySQL JSON_EXTRACT |
| tests/Query/Functions/Mysql/JsonDepthTest.php | Added WHERE clause test for MySQL JSON_DEPTH |
| tests/Query/Functions/Mysql/JsonContainsPathTest.php | Added WHERE clause test for MySQL JSON_CONTAINS_PATH |
| tests/Query/Functions/Mysql/JsonArrayInsertTest.php | Added WHERE clause test for MySQL JSON_ARRAY_INSERT |
| tests/Query/Functions/Mysql/JsonArrayAppendTest.php | Added WHERE clause test for MySQL JSON_ARRAY_APPEND |
| tests/Query/Functions/Mssql/JsonValueTest.php | Added WHERE clause test for MSSQL JSON_VALUE |
| tests/Query/Functions/Mariadb/JsonValueTest.php | Added WHERE clause test for MariaDB JSON_VALUE |
| tests/Query/Functions/Mariadb/JsonQueryTest.php | Added WHERE clause test for MariaDB JSON_QUERY |
| tests/Query/Functions/Mariadb/JsonNormalizeTest.php | Added WHERE clause test for MariaDB JSON_NORMALIZE |
| tests/Query/Functions/Mariadb/JsonExistsTest.php | Added WHERE clause test for MariaDB JSON_EXISTS |
| tests/Query/Functions/Mariadb/JsonEqualsTest.php | Added WHERE clause test for MariaDB JSON_EQUALS |
| tests/Integration/Functions/Sqlite/JsonExtractTest.php | Added integration test filtering by JSON_EXTRACT in WHERE |
| tests/Integration/Functions/Postgresql/JsonbContainsTest.php | Added integration test filtering by JSONB_CONTAINS in WHERE |
| tests/Integration/Functions/Postgresql/JsonGetTextTest.php | Added integration test filtering by JSON_GET_TEXT in WHERE |
| tests/Integration/Functions/Mysql/JsonValueTest.php | Added integration test filtering by JSON_VALUE in WHERE |
| tests/Integration/Functions/Mysql/JsonValidTest.php | Added integration test filtering by JSON_VALID in WHERE |
| tests/Integration/Functions/Mysql/JsonExtractTest.php | Added integration test filtering by JSON_EXTRACT in WHERE |
| tests/Integration/Functions/Mysql/JsonContainsTest.php | Added integration test filtering by JSON_CONTAINS in WHERE |
| tests/Integration/Functions/Mssql/JsonValueTest.php | Added integration test filtering by JSON_VALUE in WHERE |
| tests/Integration/Functions/Mariadb/JsonValueTest.php | Added integration test filtering by JSON_VALUE in WHERE |
| tests/Integration/Functions/Mariadb/JsonExistsTest.php | Added integration test filtering by JSON_EXISTS in WHERE |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create and tests where queries with json functions