From c8e2a7c7d4b328e1418f534e54ab0f104e266055 Mon Sep 17 00:00:00 2001 From: Alexander Erm Date: Wed, 15 Jun 2016 16:26:29 +0200 Subject: [PATCH] Fixed DI issue --- Command/GenerateServiceTestCommand.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Command/GenerateServiceTestCommand.php b/Command/GenerateServiceTestCommand.php index ff403ee..1a202b8 100644 --- a/Command/GenerateServiceTestCommand.php +++ b/Command/GenerateServiceTestCommand.php @@ -36,10 +36,9 @@ public function configure() ->setDescription('Generates a base php-unit file with mocked services'); } - public function setContainer(ContainerInterface $container = null) + protected function injectDependencies() { - parent::setContainer($container); - $this->testGeneratorService = $container->get('tps.test_generator'); + $this->testGeneratorService = $this->getContainer->get('tps.test_generator'); } /** @@ -50,6 +49,8 @@ public function setContainer(ContainerInterface $container = null) */ protected function execute(InputInterface $input, OutputInterface $output) { + $this->injectDependencies(); + $this->output = $output; $this->input = $input;