Esempio n. 1
0
 /**
  * Renders the catalog detail section.
  */
 public function detailAction()
 {
     if (is_object($GLOBALS['TSFE']) && isset($GLOBALS['TSFE']->config['config'])) {
         $GLOBALS['TSFE']->config['config']['noPageTitle'] = 2;
     }
     $templatePaths = Base::getAimeos()->getCustomPaths('client/html');
     $client = \Client_Html_Catalog_Detail_Factory::createClient($this->getContext(), $templatePaths);
     return $this->getClientOutput($client);
 }
 /**
  * @test
  */
 public function detailAction()
 {
     $name = 'Client_Html_Catalog_Detail_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_Detail_Factory::injectClient($name, $client);
     $output = $this->object->detailAction();
     \Client_Html_Catalog_Detail_Factory::injectClient($name, null);
     $this->assertEquals('body', $output);
 }
Esempio n. 3
0
 public function testCreateClientNameNotFound()
 {
     $this->setExpectedException('Client_Html_Exception');
     Client_Html_Catalog_Detail_Factory::createClient($this->_context, $this->_templatePaths, 'notfound');
 }
Esempio n. 4
0
 public function testDetailBody()
 {
     $start = microtime(true);
     $client = Client_Html_Catalog_Detail_Factory::createClient($this->_context, $this->_paths);
     $client->setView($this->_view);
     $client->getBody();
     $stop = microtime(true);
     echo "\n    catalog detail body: " . ($stop - $start) * 1000 . " msec\n";
 }