Source for file UnitTest.php

Documentation is available at UnitTest.php

  1. <?php
  2. /**
  3.  *  UnitTest.php
  4.  *
  5.  *  @author     Takuya Ookubo <sfio@sakura.ai.to>
  6.  *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
  7.  *  @package    Ethna
  8.  *  @version    $Id: 3095f45f756252e35be18d0d3a48deaa97f66766 $
  9.  */
  10.  
  11. /**
  12.  *  __ethna_unittest__ビューの実装
  13.  *
  14.  *  @author     Takuya Ookubo <sfio@sakura.ai.to>
  15.  *  @access     public
  16.  *  @package    Ethna
  17.  */
  18. {
  19.     /**#@+
  20.      *  @access public
  21.      */
  22.  
  23.     /** @var boolean  レイアウトテンプレートの使用フラグ       */
  24.     public $use_layout = false;
  25.  
  26.     /**#@-*/
  27.  
  28.     /**
  29.      *  遷移前処理
  30.      *
  31.      *  @access public
  32.      */
  33.     public function preforward()
  34.     {
  35.         // タイムアウトしないように変更
  36.         if (!ini_get('safe_mode')) {
  37.             $max_execution_time ini_get('max_execution_time');
  38.             set_time_limit(0);
  39.         }
  40.  
  41.         if (!headers_sent()) {
  42.             // キャッシュしない
  43.             header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
  44.             header("Last-Modified: " gmdate("D, d M Y H:i:s \G\M\T"));
  45.             header("Cache-Control: no-store, no-cache, must-revalidate");
  46.             header("Cache-Control: post-check=0, pre-check=0"false);
  47.             header("Pragma: no-cache");
  48.         }
  49.  
  50.         $ctl Ethna_Controller::getInstance();
  51.  
  52.         // cores
  53.         $this->af->setApp('app_id'$ctl->getAppId());
  54.         $this->af->setApp('ethna_version'ETHNA_VERSION);
  55.  
  56.         // include
  57.         $file sprintf("%s/%s_UnitTestManager.php",
  58.                         $ctl->getDirectory('app'),
  59.                         $ctl->getAppId()
  60.                 );
  61.         include_once $file;
  62.  
  63.         // run
  64.         $r sprintf("%s_UnitTestManager"$ctl->getAppId());
  65.         $ut new $r($this->backend);
  66.         list($report$result$ut->run();
  67.         
  68.         // result
  69.         $this->af->setApp('report'$report);
  70.         $this->af->setApp('result'$result);
  71.  
  72.         // タイムアウトを元に戻す
  73.         if (!ini_get('safe_mode')) {
  74.             set_time_limit($max_execution_time);
  75.         }
  76.     }
  77. }

Documentation generated on Fri, 11 Nov 2011 03:59:10 +0900 by phpDocumentor 1.4.3