Skip to content

Fix Cannot autowire service "php_translation.data_collector" error in… #463

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

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

axi
Copy link
Contributor

@axi axi commented Jan 24, 2022

Fix Cannot autowire service "php_translation.data_collector" error introduced in d47279e.

See d47279e#commitcomment-64500173

axi referenced this pull request Jan 24, 2022
* Use autowiring for SymfonyProfilerController

* Move autowire to the _defaults and remove another arg
Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

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

Thank you for fixing it!

@bocharsky-bw bocharsky-bw merged commit 004c8f4 into php-translation:master Jan 24, 2022
@rvanlaak
Copy link
Member

Given that tests did not catch this, could we come up with a functional kernel test for that class?

@bocharsky-bw
Copy link
Member

Yeah, good idea! It would help to prevent regression. @axi could you try to create a test that would cover this case, please?

@axi
Copy link
Contributor Author

axi commented Jan 31, 2022

Sorry, I can't think of a test covering this case, don't know where to start

@rvanlaak
Copy link
Member

Given that this is an external dependency that has to be available as service, it could be as basic as:

class TranslationDataCollectorTest extends BaseTestCase
{
    public function testFetchDataCollector(): void
    {
        $this->bootKernel();
        self::assertTrue($this->getContainer()->has(Symfony\Component\Translation\DataCollector\TranslationDataCollector::class));
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants