Skip to content

Drop the LocaleListener test case that pinned Symfony's prefix matching - #22

Merged
mSprunskas merged 1 commit into
paysera:masterfrom
vinayak-iyer-paysera:fix/locale-test-symfony-7.4-subtags
Oct 27, 2026
Merged

mSprunskas merged 1 commit into
paysera:masterfrom
vinayak-iyer-paysera:fix/locale-test-symfony-7.4-subtags

Conversation

@vinayak-iyer-paysera

@vinayak-iyer-paysera vinayak-iyer-paysera commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #21, from Marius's review.

1. LocaleListener test case breaks on the next Symfony 7.4 patch release (fixed here)

Symfony's 7.4 branch now matches whole subtags in Request::getPreferredLanguage() (symfony/symfony@f753a76fa2, 2026-10-25). The latest release, v7.4.21, does not have this change yet. From v7.4.22, the header d no longer matches the configured locale de. The case 'a tag that a configured locale starts with, from Symfony 7.1 matched to that locale' expected de, so the symfony: '7.*' jobs would fail.

This PR removes that case. It tested Symfony's matching rule, not the bundle. The listener's behaviour when no locale matches (it keeps the locale) is still covered on every Symfony version by ['de'] with en, no match keeps the locale and a malformed item is not a language. Accepting both de and unchanged would have made the case assert nothing about the bundle. The production code needs no change.

Local verification

I ran two targeted symfony/http-foundation checks with plci, Paysera's internal tool for running CI locally (PHP 8.4, highest dependencies, phpunit airgapped). Each check comes from a local-only CI file, which is not part of this PR:

http-foundation master (before) this PR
v7.4.21 (58c89144) 432 tests, OK 431 tests, OK
7.4.x-dev (3fc0bc79, has the subtag match) 1 failure: the data set above ('de', ['de'], 'd') 431 tests, OK

The 7.4.x-dev run failed on that one case only, which confirms that the other Symfony 7.1+ cases (en, en-GB, lt, higher priority) give the same results under the new matching.

2. doctrine/annotations is abandoned (no change)

Confirmed: 2.0.2 is its last version, and Packagist marks it abandoned. Composer shows the warning on every install, whatever the Symfony version. It is still needed in 2.x:

  • Symfony 3.4–6.4 read the bundle's docblock annotations through Doctrine's reader.
  • RestRouteConfigurator types it at the import, the ?Reader parameter and two private methods.
  • The tests use AnnotationReader directly.

Moving it to suggest would break those apps, so that belongs in 3.0.

🤖 Generated with Claude Code

The case expected the header "d" to select the configured locale "de" on
Symfony 7.1 and later. Symfony's 7.4 branch now matches whole subtags in
Request::getPreferredLanguage() (symfony/symfony f753a76fa2), so from the next
7.4 patch release "d" matches nothing and the listener keeps the locale. The
case tested Symfony's matching rule, not the bundle; the listener's "nothing
matched keeps the locale" path stays covered by the other cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Torus-Session: 1d8a246d-57ea-4dc2-bce3-87e42e38f61f
@mSprunskas
mSprunskas merged commit 5d75494 into paysera:master Oct 27, 2026
45 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.

2 participants