use Symfony\Component\HttpKernel\Tests\Controller\ContainerControllerResolverTest;
class ControllerResolverTest extends ContainerControllerResolverTest
{ use ExpectDeprecationTrait;
/**
* @group legacy
*/
public function testGetControllerOnContainerAware() { $resolver =
$this->
createControllerResolver();
$request = Request::
create('/'
);
$request->attributes->
set('_controller',
sprintf('%s::testAction', ContainerAwareController::
class));
$this->
expectDeprecation(sprintf('Since symfony/dependency-injection 6.4: Relying on "Symfony\Component\DependencyInjection\ContainerAwareInterface" to get the container in "%s" is deprecated, register the controller as a service and use dependency injection instead.', ContainerAwareController::
class));
$controller =
$resolver->
getController($request);
$this->
assertInstanceOf(ContainerAwareController::
class,
$controller[0
]);
$this->
assertInstanceOf(ContainerInterface::
class,
$controller[0
]->
getContainer());
$this->
assertSame('testAction',
$controller[1
]);
}