| Conditions | 3 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | protected function executeCommand($command, array $options = []) |
||
| 26 | { |
||
| 27 | $args = [ |
||
| 28 | 'command' => $command, |
||
| 29 | ]; |
||
| 30 | $args['--quiet'] = true; |
||
| 31 | $args = array_merge($args, $options); |
||
| 32 | |||
| 33 | $property = 'kernel'; |
||
| 34 | if (!property_exists($this, $property) || !$this->$property instanceof KernelInterface) { |
||
| 35 | throw new Exception( |
||
| 36 | sprintf( |
||
| 37 | 'TestCommandExecutionCapabilities can only be used if the test case has a ::%s attribute.', |
||
| 38 | $property |
||
| 39 | ) |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | $application = new Application($this->$property); |
||
| 43 | $application->setAutoExit(false); |
||
| 44 | $application->run(new ArrayInput($args)); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |