37 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
39 $this->requestMock = $this->createMock(\
Magento\Framework\
App\Request\Http::class);
40 $this->helperMock = $this->createMock(\
Magento\Framework\Json\Helper\Data::class);
42 $this->suggestAttributes =
$helper->getObject(
45 'response' => $this->responseMock,
46 'request' => $this->requestMock,
47 'jsonHelper' => $this->helperMock,
48 'attributeList' => $this->attributeListMock
55 $this->requestMock->expects(
62 $this->returnValue(
'attribute')
64 $this->attributeListMock->expects(
67 'getSuggestedAttributes' 71 $this->returnValue(
'some_value_for_json')
73 $this->helperMock->expects(
80 $this->returnValue(
'body')
82 $this->responseMock->expects($this->once())->method(
'representJson')->with(
'body');
83 $this->suggestAttributes->execute();