| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.5923 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 10 | public function __construct() |
|
| 23 | { |
||
| 24 | 10 | if (defined('PARAUNIT_PHAR_FILE')) { |
|
| 25 | // Paraunit is running as standalone PHAR archive |
||
| 26 | // PHPUnit is embedded in the archive, self execute it in special mode |
||
| 27 | $this->phpUnitBin = PARAUNIT_PHAR_FILE . ' phpunit'; |
||
| 28 | return; |
||
| 29 | } |
||
| 30 | |||
| 31 | 10 | if (file_exists(__DIR__.self::PHPUNIT_RELPATH_FOR_VENDOR)) { |
|
| 32 | $this->phpUnitBin = __DIR__.self::PHPUNIT_RELPATH_FOR_VENDOR; |
||
| 33 | 10 | } elseif (file_exists(__DIR__.self::PHPUNIT_RELPATH_FOR_STANDALONE)) { |
|
| 34 | 10 | $this->phpUnitBin = __DIR__.self::PHPUNIT_RELPATH_FOR_STANDALONE; |
|
| 35 | 10 | } else { |
|
| 36 | throw new \Exception('PHPUnit bin not found'); |
||
| 37 | } |
||
| 38 | |||
| 39 | 10 | $this->phpUnitBin = realpath($this->phpUnitBin); |
|
| 40 | 10 | } |
|
| 41 | |||
| 50 |