@@ -28,6 +28,11 @@ class RulesApplierTest extends \PHPUnit\Framework\TestCase
28
28
*/
29
29
protected $ validatorUtility ;
30
30
31
+ /**
32
+ * @var \Magento\SalesRule\Model\Quote\ChildrenValidationLocator|\PHPUnit_Framework_MockObject_MockObject
33
+ */
34
+ protected $ childrenValidationLocator ;
35
+
31
36
protected function setUp ()
32
37
{
33
38
$ this ->calculatorFactory = $ this ->createMock (
@@ -38,11 +43,15 @@ protected function setUp()
38
43
\Magento \SalesRule \Model \Utility::class,
39
44
['canProcessRule ' , 'minFix ' , 'deltaRoundingFix ' , 'getItemQty ' ]
40
45
);
41
-
46
+ $ this ->childrenValidationLocator = $ this ->createPartialMock (
47
+ \Magento \SalesRule \Model \Quote \ChildrenValidationLocator::class,
48
+ ['isChildrenValidationRequired ' ]
49
+ );
42
50
$ this ->rulesApplier = new \Magento \SalesRule \Model \RulesApplier (
43
51
$ this ->calculatorFactory ,
44
52
$ this ->eventManager ,
45
- $ this ->validatorUtility
53
+ $ this ->validatorUtility ,
54
+ $ this ->childrenValidationLocator
46
55
);
47
56
}
48
57
@@ -84,6 +93,10 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed($isChildren,
84
93
$ item ->setDiscountCalculationPrice ($ positivePrice );
85
94
$ item ->setData ('calculation_price ' , $ positivePrice );
86
95
96
+ $ this ->childrenValidationLocator ->expects ($ this ->any ())
97
+ ->method ('isChildrenValidationRequired ' )
98
+ ->will ($ this ->returnValue (true ));
99
+
87
100
$ this ->validatorUtility ->expects ($ this ->atLeastOnce ())
88
101
->method ('canProcessRule ' )
89
102
->will ($ this ->returnValue (true ));
0 commit comments