public function testApplyCustomLayoutUpdate() { $categoryId = 123; $pageLayout = 'page_layout'; $this->objectManager->expects($this->any())->method('get')->will($this->returnValueMap([['Magento\\Catalog\\Helper\\Category', $this->categoryHelper], ['Magento\\Theme\\Helper\\Layout', $this->layoutHelper]])); $this->request->expects($this->any())->method('getParam')->will($this->returnValueMap([[Action::PARAM_NAME_URL_ENCODED], ['id', false, $categoryId]])); $this->categoryFactory->expects($this->any())->method('create')->will($this->returnValue($this->category)); $this->category->expects($this->any())->method('setStoreId')->will($this->returnSelf()); $this->category->expects($this->any())->method('load')->with($categoryId)->will($this->returnSelf()); $this->categoryHelper->expects($this->any())->method('canShow')->will($this->returnValue(true)); $settings = $this->getMock('Magento\\Framework\\Object', ['getPageLayout'], [], '', false); $settings->expects($this->atLeastOnce())->method('getPageLayout')->will($this->returnValue($pageLayout)); $this->catalogDesign->expects($this->any())->method('getDesignSettings')->will($this->returnValue($settings)); $this->layoutHelper->expects($this->once())->method('applyHandle')->with($pageLayout); $this->action->execute(); }