1717use Adyen \Payment \Helper \Webhook \ExpireWebhookHandler ;
1818use Adyen \Payment \Logger \AdyenLogger ;
1919use Adyen \Payment \Model \AdyenAmountCurrency ;
20- use Adyen \Payment \Model \Config \Source \CaptureMode ;
2120use Adyen \Payment \Model \Notification ;
2221use Adyen \Payment \Test \Unit \AbstractAdyenTestCase ;
2322use Magento \Sales \Api \Data \OrderInterface ;
@@ -65,31 +64,8 @@ protected function tearDown(): void
6564 $ this ->webhookHandler = null ;
6665 }
6766
68- public function testAutoCaptureEnabled (): void
69- {
70- $ this ->configMock ->expects ($ this ->once ())
71- ->method ('getCaptureMode ' )
72- ->willReturn (CaptureMode::CAPTURE_MODE_AUTO );
73-
74- $ this ->adyenLoggerMock ->expects ($ this ->once ())->method ('addAdyenNotification ' );
75- $ this ->orderMock ->expects ($ this ->once ())->method ('addCommentToStatusHistory ' );
76- $ this ->orderHelperMock ->expects ($ this ->never ())->method ('holdCancelOrder ' );
77-
78- $ result = $ this ->webhookHandler ->handleWebhook (
79- $ this ->orderMock ,
80- $ this ->notificationMock ,
81- 'pending '
82- );
83-
84- $ this ->assertInstanceOf (OrderInterface::class, $ result );
85- }
86-
8767 public function testExpireWebhookIgnored ()
8868 {
89- $ this ->configMock ->expects ($ this ->once ())
90- ->method ('getCaptureMode ' )
91- ->willReturn (CaptureMode::CAPTURE_MODE_MANUAL );
92-
9369 $ this ->configMock ->expects ($ this ->once ())
9470 ->method ('isExpireWebhookIgnored ' )
9571 ->willReturn (true );
@@ -109,10 +85,6 @@ public function testExpireWebhookIgnored()
10985
11086 public function testHandleWebhookWithPartialExpiration ()
11187 {
112- $ this ->configMock ->expects ($ this ->once ())
113- ->method ('getCaptureMode ' )
114- ->willReturn (CaptureMode::CAPTURE_MODE_MANUAL );
115-
11688 $ this ->configMock ->expects ($ this ->once ())
11789 ->method ('isExpireWebhookIgnored ' )
11890 ->willReturn (false );
@@ -142,10 +114,6 @@ public function testHandleWebhookWithPartialExpiration()
142114
143115 public function testHandleWebhookWithShipments ()
144116 {
145- $ this ->configMock ->expects ($ this ->once ())
146- ->method ('getCaptureMode ' )
147- ->willReturn (CaptureMode::CAPTURE_MODE_MANUAL );
148-
149117 $ this ->configMock ->expects ($ this ->once ())
150118 ->method ('isExpireWebhookIgnored ' )
151119 ->willReturn (false );
@@ -176,10 +144,6 @@ public function testHandleWebhookWithShipments()
176144
177145 public function testHandleWebhookSuccessfully ()
178146 {
179- $ this ->configMock ->expects ($ this ->once ())
180- ->method ('getCaptureMode ' )
181- ->willReturn (CaptureMode::CAPTURE_MODE_MANUAL );
182-
183147 $ this ->configMock ->expects ($ this ->once ())
184148 ->method ('isExpireWebhookIgnored ' )
185149 ->willReturn (false );
0 commit comments