|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Paraunit\Process; |
|
4
|
|
|
|
|
5
|
|
|
use Paraunit\Configuration\PHPDbgBinFile; |
|
6
|
|
|
use Paraunit\Configuration\PHPUnitBinFile; |
|
7
|
|
|
use Paraunit\Configuration\PHPUnitConfig; |
|
8
|
|
|
use Paraunit\Configuration\TempFilenameFactory; |
|
9
|
|
|
|
|
10
|
|
|
class TestWithCoverageCommandLine extends TestCommandLine implements CliCommandInterface |
|
11
|
|
|
{ |
|
12
|
|
|
/** @var PHPDbgBinFile */ |
|
13
|
|
|
private $phpDbgBinFile; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* TestCliCommand constructor. |
|
17
|
|
|
* @param PHPUnitBinFile $phpUnitBin |
|
18
|
|
|
* @param PHPDbgBinFile $dbgBinFile |
|
19
|
|
|
* @param TempFilenameFactory $filenameFactory |
|
20
|
|
|
*/ |
|
21
|
4 |
|
public function __construct(PHPUnitBinFile $phpUnitBin, PHPDbgBinFile $dbgBinFile, TempFilenameFactory $filenameFactory) |
|
22
|
|
|
{ |
|
23
|
4 |
|
parent::__construct($phpUnitBin, $filenameFactory); |
|
24
|
|
|
|
|
25
|
4 |
|
$this->phpDbgBinFile = $dbgBinFile; |
|
26
|
4 |
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @return string |
|
30
|
|
|
*/ |
|
31
|
2 |
|
public function getExecutable() |
|
32
|
|
|
{ |
|
33
|
2 |
|
if ($this->phpDbgBinFile->isAvailable()) { |
|
34
|
1 |
|
return $this->phpDbgBinFile->getPhpDbgBin(); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
1 |
|
return parent::getExecutable(); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param PHPUnitConfig $config |
|
42
|
|
|
* @param string $uniqueId |
|
43
|
|
|
* @return string |
|
44
|
|
|
*/ |
|
45
|
2 |
|
public function getOptions(PHPUnitConfig $config, $uniqueId) |
|
46
|
|
|
{ |
|
47
|
2 |
|
$options = ''; |
|
48
|
2 |
|
if ($this->phpDbgBinFile->isAvailable()) { |
|
49
|
|
|
$options .= '-qrr ' |
|
50
|
1 |
|
. parent::getExecutable() . ' '; |
|
|
|
|
|
|
51
|
1 |
|
} |
|
52
|
|
|
|
|
53
|
|
|
return $options |
|
54
|
2 |
|
. parent::getOptions($config, $uniqueId) |
|
55
|
2 |
|
. ' --coverage-php ' |
|
56
|
2 |
|
. $this->filenameFactory->getFilenameForCoverage($uniqueId); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.