Skip to content

Commit

Permalink
Merge pull request #473 from karser/dont-extend-from-container-aware-…
Browse files Browse the repository at this point in the history
…command

ContainerAwareCommand is deprecated since Symfony 4.2
  • Loading branch information
alexislefebvre authored Dec 16, 2018
2 parents 478dd98 + c732089 commit 746f802
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Command/RunParatestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@

namespace Liip\FunctionalTestBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\Process\Process;

/**
* Command used to update the project.
*/
class RunParatestCommand extends ContainerAwareCommand
class RunParatestCommand extends Command implements ContainerAwareInterface
{
use ContainerAwareTrait;

private $output;

private $process;
Expand All @@ -49,17 +53,17 @@ protected function configure(): void

protected function prepare(): void
{
$this->phpunit = $this->getContainer()->getParameter('liip_functional_test.paratest.phpunit');
$this->process = $this->getContainer()->getParameter('liip_functional_test.paratest.process');
$this->phpunit = $this->container->getParameter('liip_functional_test.paratest.phpunit');
$this->process = $this->container->getParameter('liip_functional_test.paratest.process');

$this->testDbPath = $this->getContainer()->get('kernel')->getCacheDir();
$this->testDbPath = $this->container->get('kernel')->getCacheDir();
$this->output->writeln("Cleaning old dbs in $this->testDbPath ...");
$createDirProcess = new Process('mkdir -p '.$this->testDbPath);
$createDirProcess->run();
$cleanProcess = new Process("rm -fr $this->testDbPath/dbTest.db $this->testDbPath/dbTest*.db*");
$cleanProcess->run();
$this->output->writeln("Creating Schema in $this->testDbPath ...");
$application = new Application($this->getContainer()->get('kernel'));
$application = new Application($this->container->get('kernel'));
$input = new ArrayInput(['doctrine:schema:create', '--env' => 'test']);
$application->run($input, $this->output);

Expand Down

0 comments on commit 746f802

Please sign in to comment.