public function testGetRowData() { $data = ['data_value']; $document = $this->getMockBuilder('Magento\\Framework\\Api\\Search\\DocumentInterface')->getMockForAbstractClass(); $this->metadataProvider->expects($this->once())->method('getRowData')->with($document, [], [])->willReturn($data); $this->metadataProvider->expects($this->once())->method('getFields')->with($this->component)->willReturn([]); $this->metadataProvider->expects($this->once())->method('getOptions')->willReturn([]); $this->filter->expects($this->once())->method('getComponent')->willReturn($this->component); $result = $this->model->getRowData($document); $this->assertEquals($data, $result); }
public function testGetRowData() { $data = ['data_value']; /** @var DocumentInterface $document */ $document = $this->getMockBuilder(DocumentInterface::class)->getMockForAbstractClass(); $this->metadataProvider->expects($this->once())->method('getRowData')->with($document, [], [])->willReturn($data); $this->metadataProvider->expects($this->once())->method('getFields')->with($this->component)->willReturn([]); $this->metadataProvider->expects($this->once())->method('getOptions')->willReturn([]); $this->filter->expects($this->once())->method('getComponent')->willReturn($this->component); $result = $this->model->getRowData($document); $this->assertEquals($data, $result); }