Passed
Pull Request — master (#213)
by Ruslan
18:45
created

PaymentRefundFailedMessageCest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 31
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testPaymentReservationCanceledMessageIsSuccessfullyHandled() 0 14 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace PyzTest\Zed\MessageBroker\MessageHandlers\Payment\Presentation;
9
10
use Generated\Shared\Transfer\PaymentRefundFailedTransfer;
11
use PyzTest\Zed\MessageBroker\PaymentPresentationTester;
12
13
/**
14
 * Auto-generated group annotations
15
 *
16
 * @group PyzTest
17
 * @group Zed
18
 * @group MessageBroker
19
 * @group MessageHandlers
20
 * @group Payment
21
 * @group Presentation
22
 * @group PaymentRefundFailedMessageCest
23
 * Add your own group annotations below this line
24
 */
25
class PaymentRefundFailedMessageCest
26
{
27
    /**
28
     * @var string
29
     */
30
    protected const INITIAL_ITEM_STATE = 'payment refund pending';
31
32
    /**
33
     * @var string
34
     */
35
    public const FINAL_ITEM_STATE = 'payment refund failed';
36
37
    /**
38
     * @param \PyzTest\Zed\MessageBroker\PaymentPresentationTester $I
39
     *
40
     * @return void
41
     */
42
    public function testPaymentReservationCanceledMessageIsSuccessfullyHandled(PaymentPresentationTester $I): void
43
    {
44
        // Arrange
45
        $salesOrderEntity = $I->haveSalesOrder(static::INITIAL_ITEM_STATE);
46
        $paymentRefundFailedTransfer = $I->havePaymentMessageTransfer(
47
            PaymentRefundFailedTransfer::class,
48
            $salesOrderEntity,
49
        );
50
51
        // Act
52
        $I->handlePaymentMessageTransfer($paymentRefundFailedTransfer);
53
54
        // Assert
55
        $I->assertOrderHasCorrectState($salesOrderEntity, static::FINAL_ITEM_STATE);
56
    }
57
}
58