Add comprehensive tests for DibiFluentMssqlDataSource#1287
Open
ohmyfelix wants to merge 3 commits into
Open
Conversation
- Test file extending BaseDataSourceTest with all standard data source tests - MSSQL-specific tests: FilterDate (CONVERT format 112), FilterDateRange, getCount with ORDER BY removal, limit with OFFSET/FETCH syntax - Docker Compose file for local MSSQL Server 2022 development - GitHub Actions workflow with MSSQL service container and sqlsrv extension - Connection config INI for test data provider (matching Nextras pattern) - Graceful skip when sqlsrv/pdo_sqlsrv extension is not available https://claude.ai/code/session_014b98nLjqaV4knQWvMChyTD
…g real DB Remove Docker/MSSQL infrastructure and use SQLite in-memory with Dibi to verify the MSSQL-specific SQL patterns (CONVERT, OFFSET/FETCH, ORDER BY removal) via string assertions on the generated queries. https://claude.ai/code/session_014b98nLjqaV4knQWvMChyTD
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/mssql-applyfiltertext-nn-escaping #1287 +/- ##
=========================================================================
+ Coverage 46.19% 46.64% +0.45%
=========================================================================
Files 52 53 +1
Lines 2680 2714 +34
=========================================================================
+ Hits 1238 1266 +28
- Misses 1442 1448 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Extract createDataSource() helper to remove repetition - Drop unused events table and $ds property - Remove self-referential limit test assertion - Use proper Datagrid import instead of FQCN - Remove redundant comments https://claude.ai/code/session_014b98nLjqaV4knQWvMChyTD
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.
Summary
This PR adds a comprehensive test suite for the
DibiFluentMssqlDataSourceclass, covering SQL generation, filtering, sorting, and pagination functionality specific to MSSQL databases.Key Changes
DibiFluentMssqlDataSourceTest.phptwith 8 test cases covering:testGetCountRemovesOrderBy()- Verifies thatgetCount()removes ORDER BY clauses without affecting the original data sourcetestFilterOneDoesNotAddLimit()- EnsuresfilterOne()applies WHERE conditions without adding LIMITtestLimitBuildsMssqlOffsetFetchSql()- Validates MSSQL-specific OFFSET/FETCH NEXT pagination syntaxtestApplyFilterDate()- Tests date filtering with CONVERT() function for MSSQL formattestApplyFilterDateWithInvalidValue()- Ensures invalid dates don't modify the SQL querytestApplyFilterDateRangeFrom()- Tests date range filtering with only "from" datetestApplyFilterDateRangeTo()- Tests date range filtering with only "to" datetestApplyFilterDateRangeBoth()- Tests date range filtering with both datesNotable Implementation Details
CONVERT(varchar(10), ..., 112)for date formattingOFFSET ... ROWS FETCH NEXT ... ROWS ONLYinstead of LIMIThttps://claude.ai/code/session_014b98nLjqaV4knQWvMChyTD