| 1 | <?php |
||
| 13 | class MockTransport implements TransportInterface |
||
| 14 | { |
||
| 15 | const ERROR_MESSAGE = 'This is a forced exception'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var boolean |
||
| 19 | */ |
||
| 20 | private $forceError = false; |
||
| 21 | /** |
||
| 22 | * @var \Exception |
||
| 23 | */ |
||
| 24 | private $exeption = null; |
||
| 25 | |||
| 26 | public function send(Message $message) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * If force error is set to true, the method send will throw a RuntimeException when is called |
||
| 35 | * @param boolean $forceError |
||
| 36 | * @param \Exception|null $exception |
||
| 37 | */ |
||
| 38 | public function setForceError($forceError, $exception = null) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Tells if a RuntimeException will be thrown when the method send is called |
||
| 48 | * @return boolean |
||
| 49 | */ |
||
| 50 | public function isForceError() |
||
| 54 | } |
||
| 55 |