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