| @@ 68-79 (lines=12) @@ | ||
| 65 | ]); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function testHandleMapping() |
|
| 69 | { |
|
| 70 | $payment = $this->getMockBuilder(OrderPayment::class)->disableOriginalConstructor()->getMock(); |
|
| 71 | $payment->method('getMethod')->willReturn(PayoneConfig::METHOD_CREDITCARD); |
|
| 72 | ||
| 73 | $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); |
|
| 74 | $order->method('getPayment')->willReturn($payment); |
|
| 75 | $action = 'paid'; |
|
| 76 | ||
| 77 | $result = $this->classToTest->handleMapping($order, $action); |
|
| 78 | $this->assertNull($result); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| @@ 76-88 (lines=13) @@ | ||
| 73 | $this->assertNull($result); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testExecuteException() |
|
| 77 | { |
|
| 78 | $exception = new \Exception(); |
|
| 79 | $this->orderSender->method('send')->willThrowException($exception); |
|
| 80 | ||
| 81 | $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); |
|
| 82 | ||
| 83 | $observer = $this->getMockBuilder(Observer::class)->disableOriginalConstructor()->setMethods(['getOrder'])->getMock(); |
|
| 84 | $observer->method('getOrder')->willReturn($order); |
|
| 85 | ||
| 86 | $result = $this->classToTest->execute($observer); |
|
| 87 | $this->assertNull($result); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function testExecuteNoOrder() |
|
| 91 | { |
|