Пример #1
0
 public function testExecuteNullProduct()
 {
     $this->productMock->expects($this->once())->method('load')->with(59)->willReturn($this->productMock);
     $this->productModelFactoryMock->expects($this->once())->method('create')->willReturn($this->productMock);
     $this->swatchHelperMock->expects($this->once())->method('getAttributesFromConfigurable')->with($this->productMock)->willReturn([$this->attributeMock]);
     $this->swatchHelperMock->expects($this->once())->method('loadVariationByFallback')->with($this->productMock, ['size' => 454])->willReturn(null);
     $this->swatchHelperMock->expects($this->once())->method('getProductMediaGallery')->with($this->productMock)->willReturn($this->mediaGallery);
     $this->jsonMock->expects($this->once())->method('setData')->with($this->mediaGallery)->will($this->returnSelf());
     $result = $this->controller->execute();
     $this->assertInstanceOf('\\Magento\\Framework\\Controller\\Result\\Json', $result);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function getResponse()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse');
     if (!$pluginInfo) {
         return parent::getResponse();
     } else {
         return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo);
     }
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }