Fix locale discovery so provider tests run again - #1065
Open
a-vasyukov wants to merge 1 commit into
Open
Conversation
The glob in getAllLocales() still pointed at src/Faker/Provider relative to test/Faker, so on 2.0 it resolved outside the repository and returned an empty array. Every test using localeDataProvider was silently skipped: 8 methods in ProviderOverrideTest, 4 in InternetTest and 1 in PaymentTest, across all 75 locales.
Author
|
Two weeks, no CI run — workflows on PRs from outside contributors need manual approval, so the Anything you'd like changed here? If patching the path by hand looks fragile, I can resolve the |
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.
What is the reason for this PR?
Faker\Test\TestCase::getAllLocales()globs__DIR__ . '/../../src/Faker/Provider/*_*'. On2.0that path resolves outside the repository, so the glob returns an empty array,
localeDataProvider()yields no data sets, and every test using it is silently skipped — PHPUnitonly reports
skipped by data provider.Both halves of the path went stale in the same commit — 67825a1 "Fix: Flatten directory structure"
(#773, 2023-09-20): tests moved from
test/Faker/totest/, and providers moved fromsrc/Faker/Providertosrc/Provider. The glob was never updated, so these tests have not runsince then.
This affects 8 test methods in
ProviderOverrideTest, 4 inInternetTestand 1 inPaymentTest,across all 75 locales. On
1.24the same code lives intest/Faker/TestCase.php, where the pathstill resolves, so that branch is unaffected.
To reproduce on
2.0before this change:Author's checklist
Summary of changes
src/Providerrelative totest/No locales were discoveredif the path breaks againBefore:
After:
No test starts failing once they run — the suite stays green, only the count grows.
Review checklist
CHANGELOG.md