File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
app/code/Magento/Catalog/Test/Unit/Pricing/Price Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -390,4 +390,38 @@ public function dataProviderGetSavePercent()
390390 ['basePrice ' => '20.80 ' , 'tierPrice ' => '18.72 ' , 'savedPercent ' => '10 ' ]
391391 ];
392392 }
393+
394+ /**
395+ * @param null|string|float $quantity
396+ * @param float $expectedValue
397+ * @dataProvider getQuantityDataProvider
398+ */
399+ public function testGetQuantity ($ quantity , $ expectedValue )
400+ {
401+ $ tierPrice = new TierPrice (
402+ $ this ->product ,
403+ $ quantity ,
404+ $ this ->calculator ,
405+ $ this ->priceCurrencyMock ,
406+ $ this ->session ,
407+ $ this ->groupManagement ,
408+ $ this ->customerGroupRetriever
409+ );
410+
411+ $ this ->assertEquals ($ expectedValue , $ tierPrice ->getQuantity ());
412+ }
413+
414+ public function getQuantityDataProvider ()
415+ {
416+ return [
417+ [null , 1 ],
418+ ['one ' , 1 ],
419+ ['' , 1 ],
420+ [4 , 4 ],
421+ [4.5 , 4.5 ],
422+ ['0.7 ' , 0.7 ],
423+ ['0.0000000 ' , 1 ]
424+ ];
425+
426+ }
393427}
You can’t perform that action at this time.
0 commit comments