/** * @test */ public function downloadAction() { $name = '\\Aimeos\\Client\\Html\\Account\\Download\\Standard'; $client = $this->getMock($name, array('process'), array(), '', false); \Aimeos\Client\Html\Account\Download\Factory::injectClient($name, $client); $output = $this->object->downloadAction(); \Aimeos\Client\Html\Account\Download\Factory::injectClient($name, null); $this->assertEquals('', $output); }
/** * Renders the account download */ public function downloadAction() { $context = $this->getContext(); $view = $context->getView(); $client = \Aimeos\Client\Html\Account\Download\Factory::createClient($context, array()); $client->setView($view); $client->process(); $response = $view->response(); $this->response->setStatus($response->getStatusCode()); foreach ($response->getHeaders() as $key => $value) { $this->response->setHeader($key, implode(', ', $value)); } return (string) $response->getBody(); }
public function testCreateClientNameNotFound() { $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); \Aimeos\Client\Html\Account\Download\Factory::createClient($this->context, $this->templatePaths, 'notfound'); }