Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Add option to disable process isolation.
Browse files Browse the repository at this point in the history
When debugging, process isolation can make it difficult to use xdebug.
This option, when set with --no-isolate, disables the default module
isolation behavior.
  • Loading branch information
dersam committed Nov 18, 2015
1 parent ae07f21 commit cdd0c69
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/LinusShops/Prophet/Commands/Scry/PhpUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;

class PhpUnit extends Scry
{
private $isolated;
private $noIsolate;

protected function configure()
{
Expand All @@ -38,6 +38,12 @@ protected function configure()
'Indicates to prophet that it is running as a subprocess, and'.
' should assume it has only one module to run.'
)
->addOption(
'no-isolate',
null,
InputOption::VALUE_NONE,
'Disable process isolation of tests'
)
;
}

Expand All @@ -50,9 +56,9 @@ private function isIsolated()
public function doTest(Module $module, InputInterface $input, OutputInterface $output)
{
$this->isolated = $input->getOption('isolated');
$dispatcher = new EventDispatcher();
$this->noIsolate = $input->getOption('no-isolate');

if (!$this->isIsolated()) {
if (!$this->isIsolated() && !$this->noIsolate) {
$output->writeln("<info>Isolating {$module->getName()}</info>");
$cmd = $this->getProphetCall()
. " scry:phpunit --isolated -m {$module->getName()} -p {$input->getOption('path')}";
Expand Down

0 comments on commit cdd0c69

Please sign in to comment.