当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_MockObject_MockObject::getLayout方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::getLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::getLayout方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::getLayout怎么用?PHP PHPUnit_Framework_MockObject_MockObject::getLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_MockObject_MockObject的用法示例。


在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::getLayout方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testRenderLink

 public function testRenderLink()
 {
     $blockHtml = 'test';
     $name = 'test_name';
     $this->context->getLayout()->expects($this->once())->method('renderElement')->with($name)->willReturn($blockHtml);
     /** @var \Magento\Framework\View\Element\AbstractBlock $link */
     $link = $this->getMockBuilder('Magento\\Framework\\View\\Element\\AbstractBlock')->disableOriginalConstructor()->getMock();
     $link->expects($this->once())->method('getNameInLayout')->willReturn($name);
     $this->assertEquals($blockHtml, $this->block->renderLink($link));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:10,代码来源:LinksTest.php

示例2: testGetLayout

 public function testGetLayout()
 {
     $context = $this->getMock('Oro\\Component\\Layout\\ContextInterface');
     $rootId = 'test_id';
     $rawLayout = $this->getMockBuilder('Oro\\Component\\Layout\\RawLayout')->disableOriginalConstructor()->getMock();
     $rootView = $this->getMockBuilder('Oro\\Component\\Layout\\BlockView')->disableOriginalConstructor()->getMock();
     $layout = $this->getMockBuilder('Oro\\Component\\Layout\\Layout')->disableOriginalConstructor()->getMock();
     $context->expects($this->once())->method('isResolved')->will($this->returnValue(false));
     $context->expects($this->once())->method('resolve');
     $this->registry->expects($this->once())->method('configureContext')->with($this->identicalTo($context));
     $this->layoutManipulator->expects($this->at(0))->method('setBlockTheme')->with('RootTheme1', $this->identicalTo(null));
     $this->layoutManipulator->expects($this->at(1))->method('setBlockTheme')->with(['RootTheme2', 'RootTheme3'], $this->identicalTo(null));
     $this->layoutManipulator->expects($this->at(2))->method('setBlockTheme')->with(['TestTheme1', 'TestTheme2'], 'test_block');
     $this->layoutManipulator->expects($this->at(3))->method('setBlockTheme')->with('TestTheme3', 'test_block');
     $this->layoutManipulator->expects($this->once())->method('applyChanges')->with($this->identicalTo($context), false);
     $this->rawLayoutBuilder->expects($this->once())->method('getRawLayout')->will($this->returnValue($rawLayout));
     $this->blockFactory->expects($this->once())->method('createBlockView')->with($this->identicalTo($rawLayout), $this->identicalTo($context), $rootId)->will($this->returnValue($rootView));
     $this->layoutBuilder->expects($this->once())->method('createLayout')->with($this->identicalTo($rootView))->will($this->returnValue($layout));
     $rawLayout->expects($this->once())->method('getRootId')->will($this->returnValue($rootId));
     $rawLayout->expects($this->once())->method('getBlockThemes')->will($this->returnValue([$rootId => ['RootTheme1', 'RootTheme2', 'RootTheme3'], 'test_block' => ['TestTheme1', 'TestTheme2', 'TestTheme3']]));
     $layout->expects($this->at(0))->method('setBlockTheme')->with(['RootTheme1', 'RootTheme2', 'RootTheme3'], $this->identicalTo(null));
     $layout->expects($this->at(1))->method('setBlockTheme')->with(['TestTheme1', 'TestTheme2', 'TestTheme3'], 'test_block');
     $layout->expects($this->exactly(2))->method('setBlockTheme');
     $this->layoutBuilder->setBlockTheme('RootTheme1')->setBlockTheme(['RootTheme2', 'RootTheme3'])->setBlockTheme(['TestTheme1', 'TestTheme2'], 'test_block')->setBlockTheme('TestTheme3', 'test_block');
     $result = $this->layoutBuilder->getLayout($context, $rootId);
     $this->assertSame($layout, $result);
 }
开发者ID:Maksold,项目名称:platform,代码行数:27,代码来源:LayoutBuilderTest.php

示例3: testAddActionLayoutHandles

 /**
  * @magentoAppIsolation enabled
  */
 public function testAddActionLayoutHandles()
 {
     $this->_model->getRequest()->setRouteName('test')->setControllerName('controller')->setActionName('action');
     $this->_model->addActionLayoutHandles();
     $handles = $this->_model->getLayout()->getUpdate()->getHandles();
     $this->assertContains('test_controller_action', $handles);
 }
开发者ID:relue,项目名称:magento2,代码行数:10,代码来源:ActionTest.php

示例4: testAddPageLayoutHandles

 /**
  * @magentoAppIsolation enabled
  */
 public function testAddPageLayoutHandles()
 {
     $this->_model->getRequest()->setRouteName('test')->setControllerName('controller')->setActionName('action');
     //$this->_model->addPageLayoutHandles(array());
     $this->assertEmpty($this->_model->getLayout()->getUpdate()->getHandles());
     $this->_model->getRequest()->setRouteName('catalog')->setControllerName('product')->setActionName('view');
     $this->_model->addPageLayoutHandles(array('type' => 'simple'));
     $handles = $this->_model->getLayout()->getUpdate()->getHandles();
     $this->assertContains('default', $handles);
     $this->assertContains('catalog_product_view', $handles);
     $this->assertContains('catalog_product_view_type_simple', $handles);
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:15,代码来源:Action.php

示例5: testGetLayout

 /**
  * @covers \Magento\Framework\View\Result\Layout::getLayout()
  */
 public function testGetLayout()
 {
     $this->assertSame($this->layout, $this->resultLayout->getLayout());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:7,代码来源:LayoutTest.php

示例6: testSetGetLayout

 public function testSetGetLayout()
 {
     $this->assertNull($this->_helper->getLayout());
     $this->assertInstanceof(get_class($this->_helper), $this->_helper->setLayout(Mage::app()->getLayout()));
     $this->assertInstanceOf('Mage_Core_Model_Layout', $this->_helper->getLayout());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:6,代码来源:AbstractTest.php


注:本文中的PHPUnit_Framework_MockObject_MockObject::getLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。