Beispiel #1
0
 /**
  * @param \Magento\Review\Model\Review $review
  * @param array $row
  * @return void
  */
 protected function setReviewRating(\Magento\Review\Model\Review $review, $row)
 {
     $rating = $this->getRating($row['rating_code']);
     foreach ($rating->getOptions() as $option) {
         $optionId = $option->getOptionId();
         if ($option->getValue() == $row['rating_value'] && !empty($optionId)) {
             $rating->setReviewId($review->getId())->addOptionVote($optionId, $this->getProductIdBySku($row['sku']));
         }
     }
     $review->aggregate();
 }
Beispiel #2
0
 public function testAggregate()
 {
     $this->resource->expects($this->once())->method('aggregate')->with($this->equalTo($this->review))->will($this->returnValue($this->review));
     $this->assertSame($this->review, $this->review->aggregate());
 }