| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 2 | public static function configure(IOInterface $io, PhpUnit $phpUnit) |
|
| 20 | { |
||
| 21 | /** @var PhpUnit $phpUnit */ |
||
| 22 | 2 | if (true === $phpUnit->isUndefined()) { |
|
| 23 | 1 | $answer = $io->ask(HookQuestions::PHPUNIT_TOOL, HookQuestions::DEFAULT_TOOL_ANSWER); |
|
| 24 | |||
| 25 | 1 | $phpUnit = $phpUnit->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer))); |
|
| 26 | |||
| 27 | 1 | if (true === $phpUnit->isEnabled()) { |
|
| 28 | 1 | $randomAnswer = $io->ask(HookQuestions::PHPUNIT_RANDOM_MODE, HookQuestions::DEFAULT_TOOL_ANSWER); |
|
| 29 | 1 | $optionsAnswer = $io->ask(HookQuestions::PHPUNIT_OPTIONS, null); |
|
| 30 | |||
| 31 | 1 | $randomMode = new PhpUnitRandomMode(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($randomAnswer)); |
|
| 32 | 1 | $options = new PhpUnitOptions($optionsAnswer); |
|
| 33 | |||
| 34 | 1 | $phpUnit = $phpUnit->setRandomModeAndOptions($randomMode, $options); |
|
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | 2 | return $phpUnit; |
|
| 39 | } |
||
| 40 | } |
||
| 41 |