public function testGetConfigAsObjectWidgetNoFound() { $this->dataStorageMock->expects($this->once())->method('get')->willReturn([]); $resultObject = $this->widget->getConfigAsObject('Magento\\Cms\\Block\\Widget\\Page\\Link'); $this->assertInstanceOf('Magento\\Framework\\DataObject', $resultObject); $this->assertSame([], $resultObject->getData()); }
public function testGetWidgetByClassType() { $widgetOne = array('@' => array('type' => 'type1')); $widgets = array('widget1' => $widgetOne); $this->_storage->expects($this->any())->method('get')->will($this->returnValue($widgets)); $this->assertEquals($widgetOne, $this->_model->getWidgetByClassType('type1')); $this->assertNull($this->_model->getWidgetByClassType('type2')); }
public function testGetWidgetSupportedTemplatesByContainersUnknownContainer() { $expectedConfigFile = __DIR__ . '/../_files/mappedConfigArray1.php'; $widget = (include $expectedConfigFile); $this->_widgetModelMock->expects($this->once())->method('getWidgetByClassType')->will($this->returnValue($widget)); $this->_viewFileSystemMock->expects($this->once())->method('getFilename')->will($this->returnValue('')); $expectedTemplates = []; $this->assertEquals($expectedTemplates, $this->_model->getWidgetSupportedTemplatesByContainer('unknown')); }