10 use Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory;
47 $this->collectionFactoryMock = $this->getMockBuilder(CollectionFactory::class)
48 ->setMethods([
'create'])
49 ->disableOriginalConstructor()
51 $this->collectionMock = $this->objectManager->getCollectionMock(Collection::class, []);
52 $this->requestMock = $this->getMockBuilder(RequestInterface::class)
53 ->getMockForAbstractClass();
55 $this->collectionFactoryMock->expects($this->any())
57 ->willReturn($this->collectionMock);
59 $this->model = $this->objectManager->getObject(ReviewDataProvider::class, [
61 'primaryFieldName' =>
'testPrimaryFieldName',
62 'requestFieldName' =>
'testRequestFieldName',
65 'collectionFactory' => $this->collectionFactoryMock,
66 'request' => $this->requestMock,
73 'totalRecords' =>
null,
77 $this->collectionMock->expects($this->once())
78 ->method(
'addEntityFilter')
80 $this->collectionMock->expects($this->once())
81 ->method(
'addStoreData')
83 $this->requestMock->expects($this->once())
85 ->with(
'current_product_id', 0)
88 $this->assertSame($expected, $this->model->getData());