/**
  * 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 \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Checkout\Confirm\Order\Standard($this->context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
 /**
  * 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 = \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Checkout\Standard\Summary\Option\Terms\Standard($this->context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
Beispiel #3
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Basket_Mini_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
 /**
  * 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 = \TestHelper::getContext();
     $paths = \TestHelper::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 \Exception('No catalog item found');
     }
     $productManager = \Aimeos\MShop\Product\Manager\Factory::createManager($context);
     $search = $productManager->createSearch();
     $search->setConditions($search->compare('==', 'product.code', array('CNC', 'CNE')));
     $total = 0;
     $view = \TestHelper::getView();
     $view->listProductItems = $productManager->searchItems($search, array('media', 'price', 'text'), $total);
     $view->listProductTotal = $total;
     $view->listPageSize = 100;
     $view->listPageCurr = 1;
     $view->listParams = array();
     $view->listCatPath = array($catalogManager->createItem(), $catItem);
     $this->object->setView($view);
 }
 /**
  * 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 \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Account\History\Lists\Standard($this->context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
 public function testGetBodyNoCatId()
 {
     $this->object->setView(\TestHelper::getView());
     $output = $this->object->getBody();
     $this->assertRegExp('#Your search result#smU', $output);
     $this->assertStringStartsWith('<div class="catalog-stage-breadcrumb">', $output);
 }
Beispiel #7
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Catalog_List_Items_Default($context, $paths);
     $catalogManager = 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 Exception('No catalog item found');
     }
     $productManager = MShop_Product_Manager_Factory::createManager($context);
     $search = $productManager->createSearch();
     $search->setConditions($search->compare('==', 'product.code', array('CNC', 'CNE')));
     $total = 0;
     $view = TestHelper::getView();
     $view->listProductItems = $productManager->searchItems($search, array('media', 'price', 'text'), $total);
     $view->listProductTotal = $total;
     $view->listPageSize = 100;
     $view->listPageCurr = 1;
     $view->listParams = array();
     $view->listCatPath = array($catalogManager->createItem(), $catItem);
     $this->_object->setView($view);
 }
Beispiel #8
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Catalog_Stage_Navigator_Default($context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #9
0
 /**
  * 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 TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Checkout_Confirm_Order_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
 /**
  * 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 = \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Basket\Related\Standard($this->context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
Beispiel #11
0
 /**
  * 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 TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Account_History_Detail_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #12
0
 public function testProcess()
 {
     $type = MShop_Order_Item_Base_Address_Abstract::TYPE_DELIVERY;
     $manager = 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 Exception('No customer item found');
     }
     $addrItem = $customerItem->getPaymentAddress();
     $addrItem->setId(null);
     $basketCntl = Controller_Frontend_Basket_Factory::createController($this->_context);
     $basketCntl->setAddress($type, $addrItem);
     $view = TestHelper::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());
 }
Beispiel #13
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Catalog_List_Simple($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
 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('*****@*****.**');
     $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 = \TestHelper::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();
 }
Beispiel #15
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Catalog_Session_Pinned_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #16
0
 public function testProcess()
 {
     $type = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT;
     $manager = 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('*****@*****.**');
     $basketCntl = Controller_Frontend_Basket_Factory::createController($this->_context);
     $basketCntl->setAddress($type, $addrItem);
     $view = TestHelper::getView();
     $view->orderBasket = $basketCntl->get();
     $this->_object->setView($view);
     $orderBaseStub = $this->getMockBuilder('MShop_Order_Manager_Base_Default')->setConstructorArgs(array($this->_context))->setMethods(array('saveItem'))->getMock();
     $customerStub = $this->getMockBuilder('MShop_Customer_Manager_Default')->setConstructorArgs(array($this->_context))->setMethods(array('saveItem'))->getMock();
     $orderBaseStub->expects($this->once())->method('saveItem');
     $customerStub->expects($this->once())->method('saveItem');
     MShop_Factory::injectManager($this->_context, 'customer', $customerStub);
     MShop_Factory::injectManager($this->_context, 'order/base', $orderBaseStub);
     $this->_object->process();
 }
 /**
  * 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 = \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Catalog\Stage\Navigator\Standard($context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
Beispiel #18
0
 /**
  * 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 = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Checkout_Standard_Summary_Option_Terms_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #19
0
 public function testGetBody()
 {
     $view = TestHelper::getView();
     $view->standardBasket = $this->_getBasket();
     $this->_object->setView($view);
     $output = $this->_object->getBody();
     $this->assertStringStartsWith('<div class="common-summary-service container">', $output);
 }
 public function testGetBodyOtherStep()
 {
     $view = \TestHelper::getView();
     $view->standardStepActive = 'xyz';
     $this->object->setView($view);
     $output = $this->object->getBody();
     $this->assertEquals('', $output);
 }
Beispiel #21
0
 /**
  * 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 = \TestHelper::getContext();
     $methods = array('getHeader', 'getBody');
     $this->client = $this->getMock('\\Aimeos\\Client\\Html\\Catalog\\Filter\\Standard', $methods, array($context, array()));
     $this->object = new \Aimeos\Client\Html\Common\Decorator\Example($context, array(), $this->client);
     $this->object->setView(\TestHelper::getView());
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     \Aimeos\MShop\Factory::setCache(true);
     $this->context = \TestHelper::getContext();
     $paths = \TestHelper::getHtmlTemplatePaths();
     $this->object = new \Aimeos\Client\Html\Checkout\Standard\Process\Standard($this->context, $paths);
     $this->object->setView(\TestHelper::getView());
 }
Beispiel #23
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     MShop_Factory::setCache(true);
     $this->_context = TestHelper::getContext();
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Checkout_Standard_Process_Default($this->_context, $paths);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #24
0
 /**
  * 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 = TestHelper::getContext();
     $methods = array('getHeader', 'getBody');
     $this->_client = $this->getMock('Client_Html_Catalog_Filter_Default', $methods, array($context, array()));
     $this->_object = new Client_Html_Common_Decorator_Example($context, array(), $this->_client);
     $this->_object->setView(TestHelper::getView());
 }
Beispiel #25
0
 public function testGetBody()
 {
     $controller = Controller_Frontend_Basket_Factory::createController($this->_context);
     $view = TestHelper::getView();
     $view->standardBasket = $controller->get();
     $this->_object->setView($view);
     $output = $this->_object->getBody();
     $this->assertStringStartsWith('<div class="checkout-standard-summary-option container">', $output);
 }
Beispiel #26
0
 public function testGetBody()
 {
     $view = TestHelper::getView();
     $view->standardStepActive = 'payment';
     $helper = new MW_View_Helper_Parameter_Default($view, array('c-step' => 'address'));
     $view->addHelper('param', $helper);
     $this->_object->setView($view);
     $output = $this->_object->getBody();
     $this->assertStringStartsWith('<section class="arcavias checkout-standard">', $output);
     $this->assertRegExp('#<ol class="steps">.*<li class="step.*>.*</li>.*</ol>#smU', $output);
 }
Beispiel #27
0
 /**
  * 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 = TestHelper::getContext();
     $this->_emailMock = $this->getMock('MW_Mail_Message_None');
     $paths = TestHelper::getHtmlTemplatePaths();
     $this->_object = new Client_Html_Email_Watch_Text_Salutation_Default($this->_context, $paths);
     $view = TestHelper::getView();
     $view->extAddressItem = self::$_customerItem->getPaymentAddress();
     $view->addHelper('mail', new MW_View_Helper_Mail_Default($view, $this->_emailMock));
     $this->_object->setView($view);
 }
 public function testGetBody()
 {
     $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
     $view = \TestHelper::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);
 }
Beispiel #29
0
 public function testGetBody()
 {
     $controller = Controller_Frontend_Basket_Factory::createController($this->_context);
     $controller->addProduct($this->_getProductItem('CNE')->getId(), 1, array(), array(), array(), array(), array(), 'default');
     $view = TestHelper::getView();
     $view->standardBasket = $controller->get();
     $this->_object->setView($view);
     $output = $this->_object->getBody();
     $this->assertStringStartsWith('<div class="common-summary-detail container">', $output);
     $this->assertRegExp('#<tfoot>.*<tr class="tax">.*<td class="price">3.03 .+</td>.*.*</tfoot>#smU', $output);
 }
 public function testGetBody()
 {
     $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context);
     $basket = $controller->get();
     $basket->addCoupon('OPQR');
     $view = \TestHelper::getView();
     $view->standardBasket = $basket;
     $this->object->setView($view);
     $output = $this->object->getBody();
     $this->assertStringStartsWith('<div class="common-summary-coupon', $output);
 }