Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] setContainer() is not being called for autowired controller services #26554

Closed
@phansys

Description

@phansys
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.6

This is the symfony/standard-edition with the reproducible error.
Am I misunderstanding #23239, or is supposed that autowired controllers should call setContainer()?

$ ./vendor/bin/simple-phpunit --filter OtherControllerTest
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

Testing Project Test Suite
E                                                                   1 / 1 (100%)

Time: 350 ms, Memory: 14.00MB

There was 1 error:

1) Tests\AppBundle\Controller\OtherControllerTest::testOther
Error: Call to a member function getParameter() on null

vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php:40
src/AppBundle/Controller/DefaultController.php:18
src/AppBundle/Controller/OtherController.php:16
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Client.php:68
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Client.php:131
vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php:312
tests/AppBundle/Controller/OtherControllerTest.php:13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions