diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Wizard.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Wizard.php index 77c882e6e776c..a065914ae01be 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Wizard.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Wizard.php @@ -38,9 +38,7 @@ public function execute() $this->productBuilder->build($this->getRequest()); /** @var \Magento\Framework\View\Result\Layout $resultLayout */ - $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_PAGE); - $resultLayout->getLayout()->getUpdate()->removeHandle('default'); - + $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT); return $resultLayout; } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/WizardTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/WizardTest.php new file mode 100644 index 0000000000000..ea3f87d5ea4db --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/WizardTest.php @@ -0,0 +1,70 @@ +resultFactory = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->productBuilder = $this->getMockBuilder(\Magento\Catalog\Controller\Adminhtml\Product\Builder::class) + ->disableOriginalConstructor() + ->setMethods(['build']) + ->getMock(); + $this->request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $context = $this->getMockBuilder(\Magento\Backend\App\Action\Context::class) + ->disableOriginalConstructor() + ->getMock(); + + $context->expects($this->any())->method('getResultFactory')->willReturn($this->resultFactory); + $context->expects($this->any())->method('getRequest')->willReturn($this->request); + + $objectManagerHelper = new ObjectManagerHelper($this); + $this->model = $objectManagerHelper->getObject( + \Magento\ConfigurableProduct\Controller\Adminhtml\Product\Wizard::class, + [ + 'context' => $context, + 'productBuilder' => $this->productBuilder + ] + ); + } + + public function testExecute() + { + $this->productBuilder->expects($this->once())->method('build')->with($this->request); + $this->resultFactory->expects($this->once())->method('create')->with(ResultFactory::TYPE_LAYOUT); + + $this->model->execute(); + } +}