Commit 81e51c8
committed
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 propertyFile tree
3 files changed
+6
-5
lines changed- src/Translator
- src
- tests/CacheWarmer
3 files changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
187 | | - | |
188 | | - | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
194 | | - | |
| 193 | + | |
195 | 194 | | |
196 | | - | |
| 195 | + | |
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments