Skip to content

[Translation] Do not mock class DataCollectorTranslator in TranslationDataCollectorTest #61000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

santysisi
Copy link
Contributor

Q A
Branch? 8.0
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60991
License MIT

Related

This PR, along with this other PR resolves #60991.


$dataCollector = new TranslationDataCollector($translator);
$reflection = new \ReflectionClass($dataCollectorTranslator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in #61003 I suggest a slightly different approach that doesn't involve reflection to access and modify the translator's internal state

@OskarStark OskarStark changed the title [Translation] not mock class DataCollectorTranslator in test TranslationDataCollectorTest [Translation] Do not mock class DataCollectorTranslator in TranslationDataCollectorTest Jul 1, 2025
@stof
Copy link
Member

stof commented Jul 1, 2025

could we apply this in older branches to make maintenance easier by having the same test in 7.4 and 8.0 ?

@xabbuh
Copy link
Member

xabbuh commented Jul 1, 2025

I merged #61003 into the 7.4 branch. Thanks for proposing nonetheless @santysisi

@xabbuh xabbuh closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants