You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #2870 [Translator][Tests] Minor fixes in tests context (Kocal)
This PR was merged into the 2.x branch.
Discussion
----------
[Translator][Tests] Minor fixes in tests context
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Update/add documentation as required (we can help!)
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Cherry-picked from #2867, the following fixes only apply inside tests context, it does not have impact in real-life scenarios:
1. The static variable `$alreadyGenerated` now becomes a private property `alreadyGeneratedConstants. When tests were executed randomly in #2867, it was impossible to assert on generated translations files because constants names were kept in static cache even when the class `TranslationsDumper` was initialized for each test.
2. `self::$cacheDir` is a directory, so using `rmdir` is the best way to go instead of `unlink`
Commits
-------
6e58d54 [Translator] Move already generated constants from static var to class property
0 commit comments