本文整理匯總了PHP中Magento\TestFramework\Helper\Bootstrap::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Bootstrap::get方法的具體用法?PHP Bootstrap::get怎麽用?PHP Bootstrap::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\TestFramework\Helper\Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
/**
* @magentoDataFixture Magento/Sales/_files/quote.php
*/
protected function setUp()
{
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$quote = $this->_objectManager->create('Magento\\Quote\\Model\\Quote')->load(1);
$sessionQuoteMock = $this->getMockBuilder('Magento\\Backend\\Model\\Session\\Quote')->disableOriginalConstructor()->setMethods(['getCustomerId', 'getStore', 'getStoreId', 'getQuote'])->getMock();
$sessionQuoteMock->expects($this->any())->method('getCustomerId')->will($this->returnValue(1));
$sessionQuoteMock->expects($this->any())->method('getQuote')->will($this->returnValue($quote));
/** @var \Magento\Framework\View\LayoutInterface $layout */
$layout = $this->_objectManager->get('Magento\\Framework\\View\\LayoutInterface');
$this->_accountBlock = $layout->createBlock('Magento\\Sales\\Block\\Adminhtml\\Order\\Create\\Form\\Account', 'address_block' . rand(), ['sessionQuote' => $sessionQuoteMock]);
parent::setUp();
}
示例2: testPrepareAndRender
/**
* @magentoDataFixture Magento/Catalog/_files/multiple_products.php
* @magentoAppIsolation enabled
* @magentoAppArea frontend
*/
public function testPrepareAndRender()
{
$this->_helper->prepareAndRender(10, $this->_controller);
$this->assertNotEmpty($this->_controller->getResponse()->getBody());
$this->assertEquals(10, $this->objectManager->get('Magento\\Catalog\\Model\\Session')->getLastViewedProductId());
}