Ejemplo n.º 1
0
 /**
  * @test
  */
 public function updateAction()
 {
     $name = '\\Aimeos\\Client\\Html\\Checkout\\Update\\Standard';
     $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), array(), '', false);
     $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
     $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
     \Aimeos\Client\Html\Checkout\Update\Factory::injectClient($name, $client);
     $output = $this->object->updateAction();
     \Aimeos\Client\Html\Checkout\Update\Factory::injectClient($name, null);
     $this->assertEquals('body', $output);
 }
Ejemplo n.º 2
0
 /**
  * Processes update requests from payment service providers.
  */
 public function updateAction()
 {
     try {
         $context = $this->getContext();
         $templatePaths = Base::getAimeos()->getCustomPaths('client/html');
         $client = \Aimeos\Client\Html\Checkout\Update\Factory::createClient($context, $templatePaths);
         $view = $context->getView();
         $param = array_merge(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET(), \TYPO3\CMS\Core\Utility\GeneralUtility::_POST());
         $helper = new \Aimeos\MW\View\Helper\Parameter\Standard($view, $param);
         $view->addHelper('param', $helper);
         $client->setView($view);
         $client->process();
         $this->response->addAdditionalHeaderData($client->getHeader());
         return $client->getBody();
     } catch (\Exception $e) {
         @header('HTTP/1.1 500 Internal server error', true, 500);
         return 'Error: ' . $e->getMessage();
     }
 }
Ejemplo n.º 3
0
 public function testCreateClientNameNotFound()
 {
     $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception');
     \Aimeos\Client\Html\Checkout\Update\Factory::createClient($this->context, $this->templatePaths, 'notfound');
 }