Conditions | 4 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 5.5021 |
Changes | 0 |
1 | <?php |
||
24 | 32 | public function __construct() |
|
25 | { |
||
26 | 32 | if (defined('PARAUNIT_PHAR_FILE')) { |
|
27 | // Paraunit is running as a standalone PHAR archive |
||
28 | // PHPUnit is embedded in the archive, self execute it in special mode |
||
29 | $this->phpUnitBin = PARAUNIT_PHAR_FILE . ' phpunit'; |
||
30 | |||
31 | return; |
||
32 | } |
||
33 | |||
34 | 32 | if (file_exists(__DIR__ . self::PHPUNIT_RELPATH_FOR_VENDOR)) { |
|
35 | $this->phpUnitBin = realpath(__DIR__ . self::PHPUNIT_RELPATH_FOR_VENDOR); |
||
36 | |||
37 | return; |
||
38 | } |
||
39 | |||
40 | 32 | if (file_exists(__DIR__ . self::PHPUNIT_RELPATH_FOR_STANDALONE)) { |
|
41 | 32 | $this->phpUnitBin = realpath(__DIR__ . self::PHPUNIT_RELPATH_FOR_STANDALONE); |
|
42 | |||
43 | 32 | return; |
|
44 | } |
||
45 | |||
46 | throw new \RuntimeException('PHPUnit bin not found'); |
||
47 | } |
||
48 | |||
54 |