Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompositeProductBatchSizeAdjusterTest.php
Go to the documentation of this file.
1 <?php
8 
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 }