|
@@ 56-65 (lines=10) @@
|
| 53 |
|
/** |
| 54 |
|
* @test |
| 55 |
|
*/ |
| 56 |
|
public function exceptionPrintsError() |
| 57 |
|
{ |
| 58 |
|
/** @var MethodProphecy $registerTypes */ |
| 59 |
|
$registerTypes = $this->registrator->registerEnumTypes([])->willThrow(InvalidArgumentException::class); |
| 60 |
|
|
| 61 |
|
$this->commandTester->execute([]); |
| 62 |
|
|
| 63 |
|
$this->assertContains('Error!', $this->commandTester->getDisplay()); |
| 64 |
|
$registerTypes->shouldHaveBeenCalled(); |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** |
| 68 |
|
* @test |
|
@@ 70-81 (lines=12) @@
|
| 67 |
|
/** |
| 68 |
|
* @test |
| 69 |
|
*/ |
| 70 |
|
public function exceptionIsPrintedInVerboseMode() |
| 71 |
|
{ |
| 72 |
|
/** @var MethodProphecy $registerTypes */ |
| 73 |
|
$registerTypes = $this->registrator->registerEnumTypes([])->willThrow(new InvalidArgumentException( |
| 74 |
|
'The exception message' |
| 75 |
|
)); |
| 76 |
|
|
| 77 |
|
$this->commandTester->execute([], ['verbosity' => OutputInterface::VERBOSITY_VERBOSE]); |
| 78 |
|
|
| 79 |
|
$this->assertContains('The exception message', $this->commandTester->getDisplay()); |
| 80 |
|
$registerTypes->shouldHaveBeenCalled(); |
| 81 |
|
} |
| 82 |
|
} |
| 83 |
|
|