|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEcoTest\Zed\FirstData\Business; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\FirstDataOmsCommandRequestTransfer; |
|
|
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\OrderTransfer; |
|
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Auto-generated group annotations |
|
15
|
|
|
* |
|
16
|
|
|
* @group SprykerEcoTest |
|
17
|
|
|
* @group Zed |
|
18
|
|
|
* @group FirstData |
|
19
|
|
|
* @group Business |
|
20
|
|
|
* @group Facade |
|
21
|
|
|
* @group FirstDataFacadeCancelReservationTest |
|
22
|
|
|
*/ |
|
23
|
|
|
class FirstDataFacadeCancelReservationTest extends AbstractFirstDataFacadeTest |
|
24
|
|
|
{ |
|
25
|
|
|
protected const TEST_APPROVED_STATUS = 'TEST_APPROVED_STATUS'; |
|
26
|
|
|
protected const OMS_STATUS_CANCELED = 'canceled'; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var \SprykerEcoTest\Zed\FirstData\FirstDataBusinessTester |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $tester; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @return void |
|
35
|
|
|
*/ |
|
36
|
|
|
public function testExecuteCancelPreAuthOmsCommandMustUpdateStatusAfterSuccessRequest(): void |
|
37
|
|
|
{ |
|
38
|
|
|
//Arrange |
|
39
|
|
|
$clientResponse = $this->tester->getClientResponse(); |
|
40
|
|
|
$salesOrderEntity = $this->tester->createTestSalesOrderEntity(); |
|
41
|
|
|
$salesOrderItemEntity = $this->tester->createTestSalesOrderItemEntity($salesOrderEntity); |
|
42
|
|
|
$paymentFirstDataEntity = $this->tester->createTestPaymentFirstDataEntity($salesOrderEntity); |
|
43
|
|
|
$paymentFirstDataItemEntity = $this->tester->createTestPaymentFirstDataItemEntity( |
|
44
|
|
|
$paymentFirstDataEntity, |
|
45
|
|
|
$salesOrderItemEntity, |
|
46
|
|
|
static::TEST_APPROVED_STATUS |
|
47
|
|
|
); |
|
48
|
|
|
|
|
49
|
|
|
$firstDataOmsCommandRequestTransfer = (new FirstDataOmsCommandRequestTransfer()) |
|
50
|
|
|
->setOrder( |
|
51
|
|
|
(new OrderTransfer())->fromArray($salesOrderEntity->toArray(), true) |
|
52
|
|
|
); |
|
53
|
|
|
|
|
54
|
|
|
// Act |
|
55
|
|
|
$this->tester |
|
56
|
|
|
->getFirstDataFacade($this->getFirstDataBusinessFactoryMock($clientResponse)) |
|
57
|
|
|
->executeCancelReservationOmsCommand($firstDataOmsCommandRequestTransfer); |
|
58
|
|
|
|
|
59
|
|
|
$paymentFirstDataItemEntityAfterRefund = $this->tester |
|
60
|
|
|
->findTestPaymentFirstDataItemEntityById($paymentFirstDataItemEntity->getIdPaymentFirstDataItem()); |
|
61
|
|
|
|
|
62
|
|
|
//Assert |
|
63
|
|
|
$this->assertSame(static::OMS_STATUS_CANCELED, $paymentFirstDataItemEntityAfterRefund->getStatus()); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths