1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
5
|
|
|
* Use of this software requires acceptance of the Spryker Marketplace License Agreement. See LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
declare(strict_types=1); |
9
|
|
|
|
10
|
|
|
namespace SprykerTest\Zed\MerchantProduct; |
11
|
|
|
|
12
|
|
|
use Codeception\Actor; |
13
|
|
|
use Codeception\Stub; |
14
|
|
|
use Generated\Shared\Transfer\EventEntityTransfer; |
15
|
|
|
use PHPUnit\Framework\MockObject\Rule\InvokedCount; |
16
|
|
|
use Spryker\Shared\MerchantProduct\MerchantProductConfig; |
17
|
|
|
use Spryker\Zed\MerchantProduct\Dependency\Facade\MerchantProductToEventFacadeInterface; |
18
|
|
|
use Spryker\Zed\MerchantProduct\MerchantProductDependencyProvider; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Inherited Methods |
22
|
|
|
* |
23
|
|
|
* @method void wantTo($text) |
24
|
|
|
* @method void wantToTest($text) |
25
|
|
|
* @method void execute($callable) |
26
|
|
|
* @method void expectTo($prediction) |
27
|
|
|
* @method void expect($prediction) |
28
|
|
|
* @method void amGoingTo($argumentation) |
29
|
|
|
* @method void am($role) |
30
|
|
|
* @method void lookForwardTo($achieveValue) |
31
|
|
|
* @method void comment($description) |
32
|
|
|
* @method void pause($vars = []) |
33
|
|
|
* |
34
|
|
|
* @SuppressWarnings(PHPMD) |
35
|
|
|
*/ |
36
|
|
|
class MerchantProductCommunicationTester extends Actor |
37
|
|
|
{ |
38
|
|
|
use _generated\MerchantProductCommunicationTesterActions; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param int $idProductAbstract |
42
|
|
|
* |
43
|
|
|
* @return void |
44
|
|
|
*/ |
45
|
|
|
public function setDependencyWithExpectedCall(int $idProductAbstract): void |
46
|
|
|
{ |
47
|
|
|
$eventFacadeMock = Stub::makeEmpty(MerchantProductToEventFacadeInterface::class); |
48
|
|
|
$eventFacadeMock->expects(new InvokedCount(1))->method('triggerBulk')->with(MerchantProductConfig::PRODUCT_ABSTRACT_PUBLISH, [ |
49
|
|
|
(new EventEntityTransfer()) |
50
|
|
|
->setId($idProductAbstract), |
51
|
|
|
]); |
52
|
|
|
|
53
|
|
|
$this->setDependency(MerchantProductDependencyProvider::FACADE_EVENT, $eventFacadeMock); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|