Skip to content

Commit

Permalink
Do not allow tests to pass a container in to initTestTasksTrait.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 4, 2020
1 parent 39a595d commit 9f0a1af
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/src/Traits/TestTasksTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@ trait TestTasksTrait
protected $capturedOutput;
protected $logger;

public function initTestTasksTrait($commandClass = null, $container = null, $input = null)
public function initTestTasksTrait($commandClass = null)
{
if (!$container) {
$container = Robo::createDefaultContainer();
}
$this->capturedOutput = '';
$this->testPrinter = new BufferedOutput(OutputInterface::VERBOSITY_DEBUG);

$app = Robo::createDefaultApplication();
$config = new \Robo\Config();
\Robo\Robo::configureContainer($container, $app, $config, $input, $this->testPrinter);

// Set the application dispatcher
$app->setDispatcher($container->get('eventDispatcher'));
Robo::unsetContainer();
$container = Robo::createDefaultContainer(null, $this->testPrinter);
$this->logger = $container->get('logger');

// Use test class as command class if a specific one is not provided
Expand Down

0 comments on commit 9f0a1af

Please sign in to comment.