Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jun 27, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues Fix #...
License MIT

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

…s property

Otherwise the generated constants were persisted between tests, and lead to bad constants names generation.
@carsonbot carsonbot added tests Status: Needs Review Needs to be reviewed labels Jun 27, 2025
@Kocal Kocal merged commit 81e51c8 into symfony:2.x Jun 27, 2025
24 checks passed
@Kocal Kocal deleted the fix/translator-constants-generation branch June 27, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants