90% of 91OPs |
96% of 24Lines |
89% of 19Branches |
45% of 11Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\php::setBinaryPath() | 91 | 90% | 24 | 96% | 19 | 89% | 11 | 45% |
# | |
---|---|
1 |
<?php |
2 | |
3 |
namespace mageekguy\atoum; |
4 | |
5 |
use |
6 |
mageekguy\atoum, |
7 |
mageekguy\atoum\cli |
8 |
; |
9 | |
10 |
class php extends cli\command |
11 |
{ |
12 |
public function setBinaryPath($phpPath = null)96% |
13 |
{ |
14 |
if ($phpPath === null) |
15 |
{ |
16 |
if ($this->adapter->defined('PHP_BINARY') === true) |
17 |
{ |
18 |
$phpPath = $this->adapter->constant('PHP_BINARY'); |
19 |
} |
20 | |
21 |
if ($phpPath === null) |
22 |
{ |
23 |
$phpPath = $this->adapter->getenv('PHP_PEAR_PHP_BIN'); |
24 | |
25 |
if ($phpPath === false) |
26 |
{ |
27 |
$phpPath = $this->adapter->getenv('PHPBIN'); |
28 | |
29 |
if ($phpPath === false) |
30 |
{ |
31 |
$phpDirectory = $this->adapter->constant('PHP_BINDIR'); |
32 | |
33 |
if ($phpDirectory === null) |
34 |
{ |
35 |
throw new exceptions\runtime('Unable to find PHP executable'); |
36 |
} |
37 | |
38 |
$phpPath = $phpDirectory . '/php'; |
39 |
} |
40 |
} |
41 |
} |
42 |
} |
43 | |
44 |
return parent::setBinaryPath($phpPath); |
45 |
} |
46 |
} |