Skip to content

Commit

Permalink
fix FullSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnessworthy committed Nov 20, 2018
1 parent 96db31b commit a400b24
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="ParaTest Unit Tests">
Expand Down
2 changes: 1 addition & 1 deletion src/Runners/PHPUnit/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getSuitesName()
}
$nodes = $this->xml->xpath('//testsuites/testsuite');
$names = [];
while (list(, $node) = each($nodes)) {
foreach ($nodes as $node) {
$names[] = (string)$node['name'];
}
return $names;
Expand Down
45 changes: 22 additions & 23 deletions src/Runners/PHPUnit/FullSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,49 @@

namespace ParaTest\Runners\PHPUnit;

use Symfony\Component\Process\ProcessBuilder;

class FullSuite extends ExecutableTest
{
/**
* @var string
*/
protected $suiteName;

/**
* @var string
*/
protected $configPath;

/**
* @param string $suiteName
* @param string $configPath
*/
public function __construct($suiteName, $configPath)
{
parent::__construct($suiteName);

$this->suiteName = $suiteName;
$this->configPath = $configPath;
}


protected function getCommandString($binary, $options = array())
/**
* {@inheritdoc}
*/
protected function getCommandString(string $binary, array $options = [])
{
$builder = new ProcessBuilder();
$builder->setPrefix($binary);
foreach ($options as $key => $value) {
$builder->add("--$key");
if ($value !== null) {
$builder->add($value);
}
}

$builder->add('-c');
$builder->add($this->configPath);

$builder->add('--testsuite');
$builder->add($this->suiteName);

$process = $builder->getProcess();
return $process->getCommandLine();
return parent::getCommandString(
$binary,
array_merge(
$options,
[
'configuration' => $this->configPath,
'testsuite' => $this->suiteName,
]
)
);
}

public function getTestCount()
public function getTestCount(): int
{
return 1; //There is no simple way of knowing this
}
}
}

0 comments on commit a400b24

Please sign in to comment.