28 private $indexerResourceMock;
33 private $storeManagementMock;
38 private $metadataPoolMock;
43 private $connectionMock;
47 $this->connectionMock = $this->createMock(AdapterInterface::class);
48 $this->indexerResourceMock = $this->createMock(Decimal::class);
49 $this->indexerResourceMock->expects($this->any())->method(
'getConnection')->willReturn($this->connectionMock);
50 $this->storeManagementMock = $this->createMock(StoreManagementInterface::class);
51 $this->metadataPoolMock = $this->createMock(MetadataPool::class);
54 $this->storeManagementMock,
55 $this->indexerResourceMock,
56 $this->metadataPoolMock
62 $entityMetadataMock = $this->createMock(EntityMetadataInterface::class);
63 $this->metadataPoolMock->expects($this->any())
64 ->method(
'getMetadata')
65 ->with(ProductInterface::class)
66 ->willReturn($entityMetadataMock);
68 $selectMock = $this->createMock(Select::class);
70 $maxRowsPerStore = 100;
72 $this->connectionMock->expects($this->any())->method(
'select')->willReturn($selectMock);
73 $this->connectionMock->expects($this->once())->method(
'fetchOne')->willReturn($maxRowsPerStore);
74 $this->storeManagementMock->expects($this->any())->method(
'getCount')->willReturn($storeCount);
76 $this->assertEquals($maxRowsPerStore * $storeCount * 500, $this->model->estimateRowSize());