Exemplo n.º 1
0
 public function testRenderingReturnsValidHtml()
 {
     global $phpRackConfig;
     $runner = new phpRack_Runner($phpRackConfig);
     $view = new phpRack_View();
     $view->assign(array('runner' => $runner));
     $html = $view->render();
     $this->assertFalse(empty($html), "Empty HTML, why?");
 }
Exemplo n.º 2
0
     throw new Exception('You must use SSL protocol to run integration tests');
 }
 /**
  * Using this tag in GET URL we can get a summary report
  * in plain text format.
  */
 if (array_key_exists('suite', $_GET)) {
     header('Content-Type: text/plain');
     if (!$runner->getAuth()->isAuthenticated()) {
         throw new Exception('Access denied');
     }
     throw new Exception($runner->runSuite());
 }
 // Global layout is required, show the front web page of the report
 if (empty($_GET[PHPRACK_AJAX_TAG])) {
     $view = new phpRack_View();
     // show login form, if the user is not authenticated yet
     if (!$runner->getAuth()->isAuthenticated()) {
         $view->assign(array('authResult' => $runner->getAuth()->getAuthResult()));
         throw new Exception($view->render('login.phtml'));
     }
     $view->assign(array('runner' => $runner));
     /**
      * @todo #57 this line leads to the problem explained in the ticket,
      * on some servers, not everywhere. I don't know what is the reason, that's
      * why the line is commented for now.
      */
     // header('Content-Type: application/xhtml+xml');
     throw new Exception($view->render());
 }
 // show error message