Skip to content

IBX-6773: Adapted IdSortClauseQueryBuilderTest to DBAL 4 - #834

Open
tbialcz wants to merge 1 commit into
6.0from
IBX-6773-adapted-id-sort-clause-query-builder-test-to-dbal4
Open

tbialcz wants to merge 1 commit into
6.0from
IBX-6773-adapted-id-sort-clause-query-builder-test-to-dbal4

Conversation

@tbialcz

@tbialcz tbialcz commented Sep 16, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-6773

Description:

The test merged from 5.0 fails on 6.0 because it uses DBAL 3 API removed in DBAL 4: getQueryPart() and the url connection option.

The test now checks the generated SQL through getSQL() and connects to in-memory SQLite the DBAL 4 way, same as BaseLocationSortClauseQueryBuilderTest. No production code changed.

For QA:

Test-only change.

  1. vendor/bin/phpunit -c phpunit.xml tests/lib/Persistence/Legacy/Filter – all tests pass.

Documentation:

N/A

private const CONTENT_LOCATION_ALIAS = 'ibexa_sort_location';
private const SORT_ALIAS = 'ibexa_filter_sort_bookmark_id';
private const CONTENT_ITEM_TABLE = 'ezcontentobject';
private const CONTENT_ITEM_TABLE = 'ibexa_content';

@vidarl vidarl Sep 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@alongosz asked me to have a look at this PR and check if it is needed on 5.0 as well, not only 6.0.

Well, it is not needed on 5.0 as 5.0 uses dbal 3. However, the line here is obviously wrong, but test still succeeds. The test builds a FilteringQueryBuilder on in-memory SQLite purely to assemble query text, then asserts on the generated string and the join map (getQueryPart('join'), getSQL()). So no schema is created and nothing is ever run in the test.

My recommendation would be to leave the CONTENT_ITEM_TABLE part as is in this PR and instead do this in a PR merged to 5.0 and up:

+use Ibexa\Core\Persistence\Legacy\Content\Gateway as ContentGateway;
 use Ibexa\Core\Persistence\Legacy\Content\Location\Gateway as LocationGateway;

-    private const CONTENT_ITEM_TABLE = 'ezcontentobject';

             ->join(
                 'location',
-                self::CONTENT_ITEM_TABLE,
+                ContentGateway::CONTENT_ITEM_TABLE,
                 'content',

-            ->from(self::CONTENT_ITEM_TABLE, 'content');
+            ->from(ContentGateway::CONTENT_ITEM_TABLE, 'content');

I can do that if you agree

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, the CONTENT_ITEM_TABLE change is dropped from this PR, only the DBAL 4 adjustments remain. If it looks good, please approve. And yes, please go ahead with the ContentGateway::CONTENT_ITEM_TABLE change against 5.0.

@vidarl vidarl Sep 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added in 03bbfde to my existing PR #835

@tbialcz
tbialcz force-pushed the IBX-6773-adapted-id-sort-clause-query-builder-test-to-dbal4 branch from 1c26777 to a04e947 Compare September 17, 2026 07:33
@tbialcz
tbialcz force-pushed the IBX-6773-adapted-id-sort-clause-query-builder-test-to-dbal4 branch from a04e947 to a338c28 Compare September 17, 2026 07:37
@sonarqubecloud

Copy link
Copy Markdown

@tbialcz
tbialcz requested a review from vidarl September 17, 2026 08:13
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.

5 participants