Пример #1
0
 /**
  * @test
  */
 public function suggestAction()
 {
     $name = '\\Aimeos\\Client\\Html\\Catalog\\Suggest\\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\Catalog\Suggest\Factory::injectClient($name, $client);
     $output = $this->object->suggestAction();
     \Aimeos\Client\Html\Catalog\Suggest\Factory::injectClient($name, null);
     $this->assertEquals('body', $output);
 }
Пример #2
0
 /**
  * Renders a list of product names in JSON format.
  */
 public function suggestAction()
 {
     $templatePaths = Base::getAimeos()->getCustomPaths('client/html');
     $client = \Aimeos\Client\Html\Catalog\Suggest\Factory::createClient($this->getContext(), $templatePaths);
     return $this->getClientOutput($client);
 }
Пример #3
0
 public function testCreateClientNameNotFound()
 {
     $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception');
     \Aimeos\Client\Html\Catalog\Suggest\Factory::createClient($this->context, $this->templatePaths, 'notfound');
 }