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