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 FirstDataFacadeRefundTest |
22
|
|
|
*/ |
23
|
|
|
class FirstDataFacadeRefundTest extends AbstractFirstDataFacadeTest |
24
|
|
|
{ |
25
|
|
|
protected const TEST_APPROVED_STATUS = 'TEST_APPROVED_STATUS'; |
26
|
|
|
protected const OMS_STATUS_REFUNDED = 'refunded'; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var \SprykerEcoTest\Zed\FirstData\FirstDataBusinessTester |
30
|
|
|
*/ |
31
|
|
|
protected $tester; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return void |
35
|
|
|
*/ |
36
|
|
|
public function testExecuteRefundOmsCommandMustUpdateStatusAfterSuccessRequest(): 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
|
|
|
->setSalesOrderItemIds([$salesOrderItemEntity->getIdSalesOrderItem()]) |
51
|
|
|
->setOrder( |
52
|
|
|
(new OrderTransfer())->fromArray($salesOrderEntity->toArray(), true) |
53
|
|
|
); |
54
|
|
|
|
55
|
|
|
//Act |
56
|
|
|
$this->tester |
57
|
|
|
->getFirstDataFacade($this->getFirstDataBusinessFactoryMock($clientResponse)) |
58
|
|
|
->executeRefundOmsCommand($firstDataOmsCommandRequestTransfer); |
59
|
|
|
|
60
|
|
|
$paymentFirstDataItemEntityAfterRefund = $this->tester |
61
|
|
|
->findTestPaymentFirstDataItemEntityById($paymentFirstDataItemEntity->getIdPaymentFirstDataItem()); |
62
|
|
|
|
63
|
|
|
//Assert |
64
|
|
|
$this->assertSame(static::OMS_STATUS_REFUNDED, $paymentFirstDataItemEntityAfterRefund->getStatus()); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
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