Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Test
Unit
Model
ResourceModel
Product
Indexer
Price
CompositeProductBatchSizeAdjusterTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Test\Unit\Model\ResourceModel\Product\Indexer\Price
;
8
9
use
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster
;
10
use
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator
;
11
12
class
CompositeProductBatchSizeAdjusterTest
extends
\PHPUnit\Framework\TestCase
13
{
17
private
$model;
18
22
private
$relationsCalculatorMock;
23
24
protected
function
setUp
()
25
{
26
$this->relationsCalculatorMock = $this->getMockBuilder(CompositeProductRelationsCalculator::class)
27
->disableOriginalConstructor()
28
->getMock();
29
$this->model =
new
CompositeProductBatchSizeAdjuster
($this->relationsCalculatorMock);
30
}
31
32
public
function
testAdjust
()
33
{
34
$this->relationsCalculatorMock->expects($this->once())
35
->method(
'getMaxRelationsCount'
)
36
->willReturn(200);
37
$this->assertEquals(25, $this->model->adjust(5000));
38
}
39
}
Magento\Catalog\Test\Unit\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjusterTest
Definition:
CompositeProductBatchSizeAdjusterTest.php:12
Magento\Catalog\Test\Unit\Model\ResourceModel\Product\Indexer\Price
Definition:
BatchSizeCalculatorTest.php:7
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator
Definition:
CompositeProductRelationsCalculator.php:12
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster
Definition:
CompositeProductBatchSizeAdjuster.php:12
Magento\Catalog\Test\Unit\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjusterTest\setUp
setUp()
Definition:
CompositeProductBatchSizeAdjusterTest.php:24
Magento\Catalog\Test\Unit\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjusterTest\testAdjust
testAdjust()
Definition:
CompositeProductBatchSizeAdjusterTest.php:32