@@ -77,52 +77,52 @@ class BundleSelectionPriceTest extends \PHPUnit_Framework_TestCase
77
77
protected function setUp ()
78
78
{
79
79
$ this ->productMock = $ this ->getMock (
80
- ' Magento\Catalog\Model\Product ' ,
80
+ \ Magento \Catalog \Model \Product::class ,
81
81
['__wakeup ' , 'getPriceInfo ' , 'getSelectionPriceType ' , 'getSelectionPriceValue ' ],
82
82
[],
83
83
'' ,
84
84
false
85
85
);
86
86
87
87
$ this ->bundleMock = $ this ->getMock (
88
- ' Magento\Catalog\Model\Product ' ,
88
+ \ Magento \Catalog \Model \Product::class ,
89
89
['__wakeup ' , 'getPriceType ' , 'getPriceInfo ' , 'setFinalPrice ' , 'getData ' ],
90
90
[],
91
91
'' ,
92
92
false
93
93
);
94
- $ this ->calculatorMock = $ this ->getMockBuilder (' Magento\Framework\Pricing\Adjustment\CalculatorInterface ' )
94
+ $ this ->calculatorMock = $ this ->getMockBuilder (\ Magento \Framework \Pricing \Adjustment \CalculatorInterface::class )
95
95
->getMockForAbstractClass ();
96
96
$ this ->eventManagerMock = $ this ->getMock (
97
- ' Magento\Framework\Event\Manager ' ,
97
+ \ Magento \Framework \Event \Manager::class ,
98
98
['dispatch ' ],
99
99
[],
100
100
'' ,
101
101
false
102
102
);
103
103
$ this ->priceInfoMock = $ this ->getMock (
104
- ' Magento\Framework\Pricing\PriceInfo\Base ' ,
104
+ \ Magento \Framework \Pricing \PriceInfo \Base::class ,
105
105
['getPrice ' ],
106
106
[],
107
107
'' ,
108
108
false
109
109
);
110
110
$ this ->discountCalculatorMock = $ this ->getMock (
111
- ' Magento\Bundle\Pricing\Price\DiscountCalculator ' ,
111
+ \ Magento \Bundle \Pricing \Price \DiscountCalculator::class ,
112
112
[],
113
113
[],
114
114
'' ,
115
115
false
116
116
);
117
117
$ this ->finalPriceMock = $ this ->getMock (
118
- ' Magento\Catalog\Pricing\Price\FinalPrice ' ,
118
+ \ Magento \Catalog \Pricing \Price \FinalPrice::class ,
119
119
[],
120
120
[],
121
121
'' ,
122
122
false
123
123
);
124
124
$ this ->regularPriceMock = $ this ->getMock (
125
- ' Magento\Catalog\Pricing\Price\RegularPrice ' ,
125
+ \ Magento \Catalog \Pricing \Price \RegularPrice::class ,
126
126
[],
127
127
[],
128
128
'' ,
@@ -132,18 +132,18 @@ protected function setUp()
132
132
->method ('getPriceInfo ' )
133
133
->will ($ this ->returnValue ($ this ->priceInfoMock ));
134
134
135
- $ this ->priceCurrencyMock = $ this ->getMock (' \Magento\Framework\Pricing\PriceCurrencyInterface ' );
135
+ $ this ->priceCurrencyMock = $ this ->getMock (\Magento \Framework \Pricing \PriceCurrencyInterface::class );
136
136
137
137
$ this ->quantity = 1 ;
138
138
139
139
$ this ->setupSelectionPrice ();
140
140
}
141
141
142
- protected function setupSelectionPrice ($ useRegularPrice = false )
142
+ protected function setupSelectionPrice ($ useRegularPrice = false , $ qty = 1 )
143
143
{
144
144
$ this ->selectionPrice = new \Magento \Bundle \Pricing \Price \BundleSelectionPrice (
145
145
$ this ->productMock ,
146
- $ this -> quantity ,
146
+ $ qty ,
147
147
$ this ->calculatorMock ,
148
148
$ this ->priceCurrencyMock ,
149
149
$ this ->bundleMock ,
@@ -325,18 +325,7 @@ public function testFixedPriceWithMultipleQty($useRegularPrice)
325
325
{
326
326
$ qty = 2 ;
327
327
328
- $ selectionPrice = new \Magento \Bundle \Pricing \Price \BundleSelectionPrice (
329
- $ this ->productMock ,
330
- $ qty ,
331
- $ this ->calculatorMock ,
332
- $ this ->priceCurrencyMock ,
333
- $ this ->bundleMock ,
334
- $ this ->eventManagerMock ,
335
- $ this ->discountCalculatorMock ,
336
- $ useRegularPrice
337
- );
338
-
339
- $ this ->setupSelectionPrice ($ useRegularPrice );
328
+ $ this ->setupSelectionPrice ($ useRegularPrice , $ qty );
340
329
$ regularPrice = 100.125 ;
341
330
$ discountedPrice = 70.453 ;
342
331
$ convertedValue = 100.247 ;
@@ -373,7 +362,7 @@ public function testFixedPriceWithMultipleQty($useRegularPrice)
373
362
->with ($ actualPrice )
374
363
->will ($ this ->returnValue ($ expectedPrice ));
375
364
376
- $ this ->assertEquals ($ expectedPrice , $ selectionPrice ->getValue ());
365
+ $ this ->assertEquals ($ expectedPrice , $ this -> selectionPrice ->getValue ());
377
366
}
378
367
379
368
public function useRegularPriceDataProvider ()
0 commit comments