• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TestHelperHtml类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中TestHelperHtml的典型用法代码示例。如果您正苦于以下问题:PHP TestHelperHtml类的具体用法?PHP TestHelperHtml怎么用?PHP TestHelperHtml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: 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());
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php


示例2: 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());
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php


示例3: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:13,代码来源:ExampleTest.php


示例4: testProcess

 public function testProcess()
 {
     $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY;
     $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->context);
     $addrManager = $manager->getSubManager('address');
     $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->setId(null);
     $basketCntl = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
     $basketCntl->setAddress($type, $addrItem);
     $view = \TestHelperHtml::getView();
     $view->orderBasket = $basketCntl->get();
     $view->orderBasket->setCustomerId($customerItem->getId());
     $this->object->setView($view);
     $this->object->process();
     $orderAddress = $view->orderBasket->getAddress($type);
     $actual = $addrManager->getItem($orderAddress->getAddressId());
     $addrManager->deleteItem($actual->getId());
     $this->assertEquals($addrItem->getFirstname(), $actual->getFirstname());
     $this->assertEquals($addrItem->getLastname(), $actual->getLastname());
     $this->assertEquals($addrItem->getPostal(), $actual->getPostal());
     $this->assertEquals($addrItem->getTelephone(), $actual->getTelephone());
     $this->assertEquals($addrItem->getTelefax(), $actual->getTelefax());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:29,代码来源:StandardTest.php


示例5: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:7,代码来源:StandardTest.php


示例6: 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();
 }
开发者ID:skyheights,项目名称:aimeos-core,代码行数:7,代码来源:StandardTest.php


示例7: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:7,代码来源:StandardTest.php


示例8: 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);
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:7,代码来源:StandardTest.php


示例9: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:7,代码来源:StandardTest.php


示例10: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:7,代码来源:StandardTest.php


示例11: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:30,代码来源:StandardTest.php


示例12: 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('[email protected]');
     $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();
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:31,代码来源:StandardTest.php


示例13: 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());
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:7,代码来源:StandardTest.php


示例14: 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());
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php


示例15: 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);
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:34,代码来源:StandardTest.php


示例16: testGetBody

 public function testGetBody()
 {
     $view = \TestHelperHtml::getView();
     $view->standardBasket = $this->getBasket();
     $this->object->setView($view);
     $output = $this->object->getBody();
     $this->assertStringStartsWith('<div class="common-summary-service container">', $output);
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:8,代码来源:StandardTest.php


示例17: testGetBodyOtherStep

 public function testGetBodyOtherStep()
 {
     $view = \TestHelperHtml::getView();
     $view->standardStepActive = 'xyz';
     $this->object->setView($view);
     $output = $this->object->getBody();
     $this->assertEquals('', $output);
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:8,代码来源:StandardTest.php


示例18: 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();
     $this->emailMock = $this->getMock('\\Aimeos\\MW\\Mail\\Message\\None');
     $paths = \TestHelperHtml::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Email\Watch\Html\Salutation\Standard($this->context, $paths);
     $view = \TestHelperHtml::getView();
     $view->extAddressItem = self::$customerItem->getPaymentAddress();
     $view->addHelper('mail', new \Aimeos\MW\View\Helper\Mail\Standard($view, $this->emailMock));
     $this->object->setView($view);
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:17,代码来源:StandardTest.php


示例19: getProductItem

 /**
  * @param string $code
  */
 protected function getProductItem($code)
 {
     $manager = \Aimeos\MShop\Product\Manager\Factory::createManager(\TestHelperHtml::getContext());
     $search = $manager->createSearch();
     $search->setConditions($search->compare('==', 'product.code', $code));
     $items = $manager->searchItems($search, array('attribute', 'price', 'product'));
     if (($item = reset($items)) === false) {
         throw new \Exception(sprintf('No product item with code "%1$s" found', $code));
     }
     return $item;
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:14,代码来源:StandardTest.php


示例20: testGetBody

 public function testGetBody()
 {
     $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
     $view = \TestHelperHtml::getView();
     $view->standardStepActive = 'summary';
     $view->standardBasket = $controller->get();
     $view->standardSteps = array('before', 'summary');
     $this->object->setView($view);
     $output = $this->object->getBody();
     $this->assertStringStartsWith('<section class="checkout-standard-summary common-summary">', $output);
 }
开发者ID:mvnp,项目名称:aimeos-core,代码行数:11,代码来源:StandardTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TestHelperMShop类代码示例发布时间:2022-05-23
下一篇:
PHP TestHelperExtjs类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap