/**
  * @test
  */
 public function stockAction()
 {
     $name = 'Client_Html_Catalog_Stock_Default';
     $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'));
     \Client_Html_Catalog_Stock_Factory::injectClient($name, $client);
     $output = $this->object->stockAction();
     \Client_Html_Catalog_Stock_Factory::injectClient($name, null);
     $this->assertEquals('body', $output);
 }
Example #2
0
 public function testCreateClientNameNotFound()
 {
     $this->setExpectedException('Client_Html_Exception');
     Client_Html_Catalog_Stock_Factory::createClient($this->_context, $this->_templatePaths, 'notfound');
 }
Example #3
0
 /**
  * Renders the catalog stock section.
  */
 public function stockAction()
 {
     $templatePaths = Base::getAimeos()->getCustomPaths('client/html');
     $client = \Client_Html_Catalog_Stock_Factory::createClient($this->getContext(), $templatePaths);
     return $this->getClientOutput($client);
 }