/** * @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); }
/** * 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(); } }
public function testCreateClientNameNotFound() { $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); \Aimeos\Client\Html\Checkout\Update\Factory::createClient($this->context, $this->templatePaths, 'notfound'); }