Skip to content

Tests json functions in where queries#135

Merged
Hikariii merged 1 commit intoScientaNL:masterfrom
Hikariii:chore/addWhereTests
Mar 6, 2026
Merged

Tests json functions in where queries#135
Hikariii merged 1 commit intoScientaNL:masterfrom
Hikariii:chore/addWhereTests

Conversation

@Hikariii
Copy link
Copy Markdown
Member

@Hikariii Hikariii commented Mar 6, 2026

Create and tests where queries with json functions

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

Coverage Report

Suite Coverage Change vs master
Unit 97.7% +0.0% ✅
Integration 88.5% +0.0% ✅

Copy link
Copy Markdown

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 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.

@Hikariii Hikariii merged commit 686dcf9 into ScientaNL:master Mar 6, 2026
18 checks passed
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.

3 participants