| @@ 129-136 (lines=8) @@ | ||
| 126 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 127 | } |
|
| 128 | ||
| 129 | public function testExecuteException() |
|
| 130 | { |
|
| 131 | $exception = new \Exception(); |
|
| 132 | $this->order->method('cancel')->willThrowException($exception); |
|
| 133 | ||
| 134 | $result = $this->classToTest->execute(); |
|
| 135 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 136 | } |
|
| 137 | ||
| 138 | public function testExecuteLocalizedException() |
|
| 139 | { |
|
| @@ 138-145 (lines=8) @@ | ||
| 135 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 136 | } |
|
| 137 | ||
| 138 | public function testExecuteLocalizedException() |
|
| 139 | { |
|
| 140 | $exception = new LocalizedException(__('An error occured')); |
|
| 141 | $this->order->method('cancel')->willThrowException($exception); |
|
| 142 | ||
| 143 | $result = $this->classToTest->execute(); |
|
| 144 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 145 | } |
|
| 146 | } |
|
| 147 | ||
| @@ 93-100 (lines=8) @@ | ||
| 90 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 91 | } |
|
| 92 | ||
| 93 | public function testExecuteException() |
|
| 94 | { |
|
| 95 | $exception = new \Exception; |
|
| 96 | $this->returnHandler->expects($this->once())->method('handlePayPalReturn')->willThrowException($exception); |
|
| 97 | ||
| 98 | $result = $this->classToTest->execute(); |
|
| 99 | $this->assertInstanceOf(Redirect::class, $result); |
|
| 100 | } |
|
| 101 | } |
|
| 102 | ||