Repository navigation
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.
|
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 |
|
Hi, thanks for the fix. I hit the same problem independently while running the existing test suite and can confirm it. Environment: Windows 11, PHP 8.3.33, PHPUnit 9.6.38, branch 2.0 at commit 82f77b1 (2026-02-04). Before the fix: Tests: 1416, Assertions: 10498, Skipped: 16. Fourteen of the skips were "skipped by data provider". With only the one-line glob change: Tests: 2452, Assertions: 12459, Skipped: 34, OK. With this PR's branch: Tests: 2453, Assertions: 12460, Skipped: 34, OK. That is my result plus the new regression test, and the diff of test/TestCase.php is identical to my local change. The 34 skips look expected: 28 locales without an IBAN format and 4 without a bankAccountNumber implementation (PaymentTest), plus 2 ImageTest cases because via.placeholder.com is offline. My assertion counts are 3 higher than in the PR description both before and after (10498 vs 10495, 12460 vs 12457), probably environment-related. Since CI has not run on this PR, this is an additional local verification on a different environment. Looks good from my side, though I cannot approve it. |
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