public function testGetPackageThemeOptionsArray() { $block = new Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Settings(); $options = $block->getPackageThemeOptionsArray(); $this->assertArrayHasKey(0, $options); // -- please select -- $this->assertArrayHasKey(1, $options); // at least one design package }
/** * Retrieve array (widget_type => widget_name) of available widgets * * Replaces occurrence of core product widget block with alias of new block implementing form keys correctly * * @see MPower_ProductBlockFormKey_Block_Catalog_Product_Widget_New * @return array */ public function getTypesOptionsArray() { $widgets = parent::getTypesOptionsArray(); $widgets = $this->_getDispatcherHelper()->dispatchEvent('adminhtml_widget_instance_edit_tab_settings_get_type_options_array_before', $widgets, 'widgets'); foreach ($widgets as &$widget) { /** @var string[] $widget */ if (is_array($widget) && array_key_exists('value', $widget) && $widget['value'] == $this->_overwrittenBlockAlias) { $widget['value'] = $this->_newBlockAlias; break; } } $widgets = $this->_getDispatcherHelper()->dispatchEvent('adminhtml_widget_instance_edit_tab_settings_get_type_options_array_after', $widgets, 'widgets'); return $widgets; }