Exemplo n.º 1
0
 /**
  * @param string $aggregation
  * @param array $aggregationAliases
  * @param string $expectedType
  *
  * @dataProvider getBestsellersReportUpdateRatingPosProvider
  */
 public function testGetBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $expectedType)
 {
     $mainTable = 'main_table';
     $aggregationTable = 'aggregation_table';
     $this->resourceHelper->expects($this->once())->method('updateReportRatingPos')->with($this->adapterMock, $expectedType, 'qty_ordered', $mainTable, $aggregationTable);
     $this->appResource->expects($this->once())->method('getConnection')->with('sales_write')->willReturn($this->adapterMock);
     $this->helper->getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $mainTable, $aggregationTable);
 }
Exemplo n.º 2
0
 /**
  * Update rating position
  *
  * @param string $aggregation One of \Magento\Sales\Model\Resource\Report\Bestsellers::AGGREGATION_XXX constants
  * @return $this
  */
 protected function _updateRatingPos($aggregation)
 {
     $aggregationTable = $this->getTable('sales_bestsellers_aggregated_' . $aggregation);
     $aggregationAliases = ['daily' => self::AGGREGATION_DAILY, 'monthly' => self::AGGREGATION_MONTHLY, 'yearly' => self::AGGREGATION_YEARLY];
     $this->_salesResourceHelper->getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $this->getMainTable(), $aggregationTable);
     return $this;
 }