| Conditions | 4 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function __construct() |
||
| 25 | { |
||
| 26 | 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 | 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 | if (file_exists(__DIR__ . self::PHPUNIT_RELPATH_FOR_STANDALONE)) { |
||
| 41 | $this->phpUnitBin = realpath(__DIR__ . self::PHPUNIT_RELPATH_FOR_STANDALONE); |
||
| 42 | |||
| 43 | return; |
||
| 44 | } |
||
| 45 | |||
| 46 | throw new \RuntimeException('PHPUnit bin not found'); |
||
| 47 | } |
||
| 48 | |||
| 54 |