11 class RssTest extends \PHPUnit\Framework\TestCase
35 $this->managerInterface = $this->createMock(\
Magento\Framework\Event\ManagerInterface::class);
36 $this->reviewFactory = $this->createPartialMock(\
Magento\
Review\Model\ReviewFactory::class, [
'create']);
38 $this->objectManagerHelper =
new ObjectManagerHelper($this);
39 $this->rss = $this->objectManagerHelper->getObject(
42 'eventManager' => $this->managerInterface,
43 'reviewFactory' => $this->reviewFactory
50 $reviewModel = $this->createPartialMock(\
Magento\
Review\Model\Review::class, [
52 'getProductCollection' 58 'addAttributeToSelect',
62 $reviewModel->expects($this->once())->method(
'getProductCollection')
64 $this->reviewFactory->expects($this->once())->method(
'create')->will($this->returnValue($reviewModel));
65 $productCollection->expects($this->once())->method(
'addStatusFilter')->will($this->returnSelf());
66 $productCollection->expects($this->once())->method(
'addAttributeToSelect')->will($this->returnSelf());
67 $productCollection->expects($this->once())->method(
'setDateOrder')->will($this->returnSelf());
68 $this->managerInterface->expects($this->once())->method(
'dispatch')->will($this->returnSelf());