本文整理汇总了PHP中TestHelperHtml::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHelperHtml::getView方法的具体用法?PHP TestHelperHtml::getView怎么用?PHP TestHelperHtml::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelperHtml
的用法示例。
在下文中一共展示了TestHelperHtml::getView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testProcessOK
public function testProcessOK()
{
$controller = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
$baseManager = \Aimeos\MShop\Order\Manager\Factory::createManager($this->context)->getSubManager('base');
$serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager($this->context);
$search = $serviceManager->createSearch();
$search->setConditions($search->compare('==', 'service.code', 'unitpaymentcode'));
$result = $serviceManager->searchItems($search);
if (($serviceItem = reset($result)) === false) {
throw new \RuntimeException('No service item found');
}
$controller->setService('payment', $serviceItem->getId());
$controller->setAddress('payment', array('order.base.address.languageid' => 'en'));
$this->context->setUserId('-1');
$view = \TestHelperHtml::getView();
$param = array('cs_order' => 1);
$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
$view->addHelper('param', $helper);
$this->object->setView($view);
$this->object->process();
$search = $baseManager->createSearch();
$search->setConditions($search->compare('==', 'order.base.customerid', '-1'));
$result = $baseManager->searchItems($search);
if (($item = reset($result)) === false) {
throw new \RuntimeException('No order placed');
}
$baseManager->deleteItem($item->getId());
$this->assertInstanceOf('\\Aimeos\\MShop\\Order\\Item\\Iface', $view->orderItem);
$this->assertEquals($item->getId(), $view->orderItem->getBaseId());
}
示例2: testGetBodyNoCatId
public function testGetBodyNoCatId()
{
$this->object->setView(\TestHelperHtml::getView());
$output = $this->object->getBody();
$this->assertRegExp('#Your search result#smU', $output);
$this->assertStringStartsWith('<div class="catalog-stage-breadcrumb">', $output);
}
示例3: testGetBodyException
public function testGetBodyException()
{
$object = $this->getMockBuilder('\\Aimeos\\Client\\Html\\Catalog\\Count\\Standard')->setConstructorArgs(array($this->context, array()))->setMethods(array('setViewParams'))->getMock();
$object->expects($this->once())->method('setViewParams')->will($this->throwException(new \RuntimeException()));
$object->setView(\TestHelperHtml::getView());
$this->assertEquals(null, $object->getBody());
}
示例4: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->context = \TestHelperHtml::getContext();
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Checkout\Standard\Summary\Option\Terms\Standard($this->context, $paths);
$this->object->setView(\TestHelperHtml::getView());
}
示例5: testGetBodyException
public function testGetBodyException()
{
$object = $this->getMockBuilder('\\Aimeos\\Client\\Html\\Checkout\\Confirm\\Standard')->setConstructorArgs(array($this->context, array()))->setMethods(array('setViewParams'))->getMock();
$object->expects($this->once())->method('setViewParams')->will($this->throwException(new \RuntimeException()));
$object->setView(\TestHelperHtml::getView());
$this->assertContains('A non-recoverable error occured', $object->getBody());
}
示例6: testProcess
public function testProcess()
{
$type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT;
$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->context);
$search = $manager->createSearch();
$search->setSlice(0, 1);
$result = $manager->searchItems($search);
if (($customerItem = reset($result)) === false) {
throw new \RuntimeException('No customer item found');
}
$addrItem = $customerItem->getPaymentAddress();
$addrItem->setEmail('unittest@aimeos.org');
$basketCntl = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
$basketCntl->setAddress($type, $addrItem);
$view = \TestHelperHtml::getView();
$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('cs_option_account' => 1));
$view->addHelper('param', $helper);
$view->orderBasket = $basketCntl->get();
$this->context->setView($view);
$this->object->setView($view);
$orderBaseStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$orderBaseStub->expects($this->once())->method('saveItem');
$customerStub->expects($this->once())->method('saveItem');
\Aimeos\MShop\Factory::injectManager($this->context, 'customer', $customerStub);
\Aimeos\MShop\Factory::injectManager($this->context, 'order/base', $orderBaseStub);
$this->object->process();
}
示例7: testGetBodyMShopException
public function testGetBodyMShopException()
{
$object = $this->getMockBuilder('\\Aimeos\\Client\\Html\\Account\\Watch\\Standard')->setConstructorArgs(array($this->context, array()))->setMethods(array('setViewParams'))->getMock();
$object->expects($this->once())->method('setViewParams')->will($this->throwException(new \Aimeos\MShop\Exception('test exception')));
$object->setView(\TestHelperHtml::getView());
$this->assertContains('test exception', $object->getBody());
}
示例8: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$context = \TestHelperHtml::getContext();
$this->client = $this->getMockBuilder('\\Aimeos\\Client\\Html\\Catalog\\Filter\\Standard')->setMethods(array('getHeader', 'getBody', 'testMethod'))->setConstructorArgs(array($context, array()))->getMock();
$this->object = new \Aimeos\Client\Html\Common\Decorator\Example($this->client, $context, array());
$this->object->setView(\TestHelperHtml::getView());
}
示例9: testProcess
public function testProcess()
{
$type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT;
$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->context);
$search = $manager->createSearch();
$search->setSlice(0, 1);
$result = $manager->searchItems($search);
if (($customerItem = reset($result)) === false) {
throw new \Exception('No customer item found');
}
$addrItem = $customerItem->getPaymentAddress();
$addrItem->setEmail('unittest@aimeos.org');
$mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None')->disableOriginalConstructor()->getMock();
$mailMsgStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\Message\\None')->disableOriginalConstructor()->disableOriginalClone()->getMock();
$mailStub->expects($this->once())->method('createMessage')->will($this->returnValue($mailMsgStub));
$mailStub->expects($this->once())->method('send');
$this->context->setMail($mailStub);
$basketCntl = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
$basketCntl->setAddress($type, $addrItem);
$view = \TestHelperHtml::getView();
$view->orderBasket = $basketCntl->get();
$this->context->setView($view);
$this->object->setView($view);
$orderBaseStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$orderBaseStub->expects($this->once())->method('saveItem');
$customerStub->expects($this->once())->method('saveItem');
\Aimeos\MShop\Factory::injectManager($this->context, 'customer', $customerStub);
\Aimeos\MShop\Factory::injectManager($this->context, 'order/base', $orderBaseStub);
$this->object->process();
}
示例10: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->context = clone \TestHelperHtml::getContext();
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Account\History\Lists\Standard($this->context, $paths);
$this->object->setView(\TestHelperHtml::getView());
}
示例11: setUp
protected function setUp()
{
$this->context = clone \TestHelperHtml::getContext();
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Checkout\Confirm\Order\Standard($this->context, $paths);
$this->object->setView(\TestHelperHtml::getView());
}
示例12: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$context = \TestHelperHtml::getContext();
$config = $context->getConfig();
$config->set('client/html/catalog/lists/basket-add', true);
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Catalog\Lists\Items\Standard($context, $paths);
$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($context);
$search = $catalogManager->createSearch();
$search->setConditions($search->compare('==', 'catalog.code', 'cafe'));
$catItems = $catalogManager->searchItems($search);
if (($catItem = reset($catItems)) === false) {
throw new \RuntimeException('No catalog item found');
}
$domains = array('media', 'price', 'text', 'attribute', 'product');
$productManager = \Aimeos\MShop\Product\Manager\Factory::createManager($context);
$search = $productManager->createSearch();
$search->setConditions($search->compare('==', 'product.code', array('CNE', 'U:TEST', 'U:BUNDLE')));
$total = 0;
$view = \TestHelperHtml::getView('unittest', $config);
$view->listProductItems = $productManager->searchItems($search, $domains, $total);
$view->listProductTotal = $total;
$view->listPageSize = 100;
$view->listPageCurr = 1;
$view->listParams = array();
$view->listCatPath = array($catalogManager->createItem(), $catItem);
$this->object->setView($view);
}
示例13: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->context = \TestHelperHtml::getContext();
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Catalog\Session\Pinned\Standard($this->context, $paths);
$this->object->setView(\TestHelperHtml::getView());
}
示例14: testGetBodyException
public function testGetBodyException()
{
$mock = $this->getMockBuilder('\\Aimeos\\Client\\Html\\Basket\\Standard\\Standard')->setConstructorArgs(array($this->context, \TestHelperHtml::getHtmlTemplatePaths()))->setMethods(array('setViewParams'))->getMock();
$mock->setView(\TestHelperHtml::getView());
$mock->expects($this->once())->method('setViewParams')->will($this->throwException(new \Exception()));
$mock->getBody();
}
示例15: setUp
protected function setUp()
{
$this->context = \TestHelperHtml::getContext();
$paths = \TestHelperHtml::getHtmlTemplatePaths();
$this->object = new \Aimeos\Client\Html\Basket\Related\Bought\Standard($this->context, $paths);
$this->object->setView(\TestHelperHtml::getView());
}