Skip to content

Commit

Permalink
EZP-28224: Change the way cache is cleared in Behat tests (ezsystems#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon authored and Łukasz Serwatka committed Apr 18, 2018
1 parent 8d9158b commit baccad3
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -6,6 +6,9 @@
namespace eZ\Bundle\EzPublishCoreBundle\Features\Context;

use Behat\Behat\Context\Context;
use Behat\Symfony2Extension\Context\KernelDictionary;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Yaml\Yaml;

/**
Expand All @@ -16,6 +19,8 @@
*/
class YamlConfigurationContext implements Context
{
use KernelDictionary;

private static $platformConfigurationFilePath = 'app/config/ezplatform_behat.yml';

public function addConfiguration(array $configuration)
Expand All @@ -30,7 +35,14 @@ public function addConfiguration(array $configuration)

$this->addImportToPlatformYaml($destinationFileName);

shell_exec('php bin/console --env=behat cache:clear');
$application = new Application($this->getKernel());
$application->setAutoExit(false);

$input = new ArrayInput([
'command' => 'cache:clear',
]);

$application->run($input);
}

private function addImportToPlatformYaml($importedFileName)
Expand Down

0 comments on commit baccad3

Please sign in to comment.