예제 #1
0
 public function testdisplay()
 {
     error_reporting(E_ERROR | E_PARSE);
     //test with a valid module but invalid action. it should return false.
     $view = new ViewClassic();
     $view->module = 'Home';
     $view->action = '';
     $ret = $view->display();
     $this->assertFalse($ret);
     //test with a valid module and uncustomized action. it should return true
     $view = new ViewClassic();
     $view->module = 'Home';
     $view->action = 'About';
     ob_start();
     $ret = $view->display();
     $renderedContent = ob_get_contents();
     ob_end_clean();
     $this->assertGreaterThan(0, strlen($renderedContent));
     $this->assertTrue($ret);
     //test with a valid module and customized action. it should return true
     $view = new ViewClassic();
     $view->module = 'Home';
     $view->action = 'index';
     ob_start();
     $ret = $view->display();
     $renderedContent = ob_get_contents();
     ob_end_clean();
     $this->assertGreaterThan(0, strlen($renderedContent));
     $this->assertTrue($ret);
 }
예제 #2
0
 function __construct()
 {
     /* BEGIN - SECURITY GROUPS - The whole file is custom but the purpose is the following code */
     //turn on normal display of subpanels
     $this->options['show_subpanels'] = true;
     /* END - SECURITY GROUPS */
     parent::__construct();
 }
예제 #3
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     parent::display();
     $this->action = $GLOBALS['action'];
 }