本文整理汇总了PHP中Mage_Core_Model_Layout类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout类的具体用法?PHP Mage_Core_Model_Layout怎么用?PHP Mage_Core_Model_Layout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Model_Layout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetMethodsNoChild
public function testGetMethodsNoChild()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Checkout_Block_Cart');
$methods = $block->getMethods('child');
$this->assertEquals(array(), $methods);
}
示例2: testGetMassactionBlock
public function testGetMassactionBlock()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Widget_Grid', 'block');
$child = $layout->addBlock('Mage_Core_Block_Template', 'massaction', 'block');
$this->assertSame($child, $block->getMassactionBlock());
}
示例3: testGetGridJsObject
/**
* @magentoAppIsolation enabled
*/
public function testGetGridJsObject()
{
Mage::register('current_product', new Varien_Object());
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config', 'block');
$this->assertEquals('super_product_linksJsObject', $block->getGridJsObject());
}
示例4: testGetAdditionalActionBlock
public function testGetAdditionalActionBlock()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Widget_Grid_Massaction_Item', 'block');
$expected = $layout->addBlock('Mage_Core_Block_Template', 'additional_action', 'block');
$this->assertSame($expected, $block->getAdditionalActionBlock());
}
示例5: showAddressFields
/**
* @param Mage_Core_Model_Layout
*/
protected function showAddressFields(Mage_Core_Model_Layout $layout)
{
$registerForm = $layout->getBlock('customer_form_register');
if ($registerForm instanceof Mage_Core_Block_Abstract) {
$registerForm->setShowAddressFields(true);
}
}
示例6: setUp
protected function setUp()
{
$this->_layoutMock = Mage::getModel('Mage_Core_Model_Layout');
$this->_block = $this->_layoutMock->createBlock('Mage_Backend_Block_Widget_Grid_Extended', 'grid', array('layout' => $this->_layoutMock));
$this->_block->addColumn('column1', array('id' => 'columnId1'));
$this->_block->addColumn('column2', array('id' => 'columnId2'));
}
示例7: setUp
protected function setUp()
{
$customer = new Mage_Customer_Model_Customer();
$customer->load(1);
Mage::register('current_customer', $customer);
$layout = new Mage_Core_Model_Layout(array('area' => 'adminhtml'));
$this->_block = $layout->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion');
}
示例8: _getFormInstance
/**
* Get form instance
*
* @param array $args
* @return Varien_Data_Form
*/
protected function _getFormInstance($args = array())
{
$layout = new Mage_Core_Model_Layout();
/** @var $block Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form */
$block = $layout->createBlock('Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form', 'block', $args);
$block->toHtml();
return $block->getForm();
}
示例9: testGetHeaderText
/**
* @param $registryData
* @param $expected
* @dataProvider getStoreDataForBlock
*/
public function testGetHeaderText($registryData, $expected)
{
$this->_initStoreTypesInRegistry($registryData);
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_System_Store_Edit', 'block');
$block->setArea(Mage_Core_Model_App_Area::AREA_ADMINHTML);
$this->assertEquals($expected, $block->getHeaderText());
}
示例10: testToHtmlFormId
public function testToHtmlFormId()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select', 'select');
$html = $block->getPriceTypeSelectHtml();
$this->assertContains('select_{{select_id}}', $html);
$this->assertContains('[{{select_id}}]', $html);
}
示例11: testGetColumns
public function testGetColumns()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->addBlock('Mage_Wishlist_Block_Customer_Wishlist_Items', 'test');
$child = $this->getMock('Mage_Core_Block_Text', array('isEnabled'));
$child->expects($this->any())->method('isEnabled')->will($this->returnValue(true));
$layout->addBlock($child, 'child', 'test');
$this->assertSame(array($child), $block->getColumns());
}
示例12: testSetListOrders
public function testSetListOrders()
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock('Mage_Core_Block_Text', 'head');
// The tested block is using head block
$block = $layout->addBlock('Mage_CatalogSearch_Block_Result', 'block');
$childBlock = $layout->addBlock('Mage_Core_Block_Text', 'search_result_list', 'block');
$this->assertSame($childBlock, $block->getListBlock());
}
示例13: testGetMode
public function testGetMode()
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock($this->_block, 'test');
$expected = uniqid();
$toolbar = new Mage_Core_Block_Text(array('current_mode' => $expected));
$layout->addBlock($toolbar, 'toolbar', 'test');
$this->assertEquals($expected, $this->_block->getMode());
}
示例14: testPrepareLayout
/**
* Test prepare layout
*
* @dataProvider prepareLayoutDataProvider
*
* @param array $blockAttributes
* @param array $expected
*/
public function testPrepareLayout($blockAttributes, $expected)
{
$layout = new Mage_Core_Model_Layout(array('area' => Mage_Core_Model_App_Area::AREA_ADMINHTML));
/** @var $block Mage_Adminhtml_Block_Urlrewrite_Edit */
$block = $layout->createBlock('Mage_Adminhtml_Block_Urlrewrite_Edit', '', $blockAttributes);
$this->_checkSelector($block, $expected);
$this->_checkButtons($block, $expected);
$this->_checkForm($block, $expected);
}
示例15: performUploadButtonTest
/**
* Reuse code for testing getUploadButtonHtml()
*
* @param Mage_Core_Block_Abstract $block
*/
public static function performUploadButtonTest(Mage_Core_Block_Abstract $block)
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock($block, 'links');
$expected = uniqid();
$text = new Mage_Core_Block_Text(array('text' => $expected));
$layout->addBlock($text, 'upload_button', 'links');
self::assertEquals($expected, $block->getUploadButtonHtml());
}