Source for file Ethna_View_UnitTest.php

Documentation is available at Ethna_View_UnitTest.php

  1. <?php
  2. /**
  3.  *  Ethna_View_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$
  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.      *  遷移前処理
  21.      *
  22.      *  @access public
  23.      */
  24.     function preforward()
  25.     {
  26.         // タイムアウトしないように変更
  27.         if (!ini_get('safe_mode')) {
  28.             $max_execution_time ini_get('max_execution_time');
  29.             set_time_limit(0);
  30.         }
  31.  
  32.         if (!headers_sent()) {
  33.             // キャッシュしない
  34.             header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
  35.             header("Last-Modified: " gmdate("D, d M Y H:i:s \G\M\T"));
  36.             header("Cache-Control: no-store, no-cache, must-revalidate");
  37.             header("Cache-Control: post-check=0, pre-check=0"false);
  38.             header("Pragma: no-cache");
  39.         }
  40.  
  41.         $ctl =Ethna_Controller::getInstance();
  42.  
  43.         // cores
  44.         $this->af->setApp('app_id'$ctl->getAppId());
  45.         $this->af->setApp('ethna_version'ETHNA_VERSION);
  46.  
  47.         // include
  48.         $file sprintf("%s/%s_UnitTestManager.php",
  49.                         $ctl->getDirectory('app'),
  50.                         $ctl->getAppId()
  51.                 );
  52.         include_once $file;
  53.  
  54.         // run
  55.         $r sprintf("%s_UnitTestManager"$ctl->getAppId());
  56.         $ut =new $r($this->backend);
  57.         list($report$result$ut->run();
  58.         
  59.         // result
  60.         $this->af->setApp('report'$report);
  61.         $this->af->setApp('result'$result);
  62.  
  63.         // タイムアウトを元に戻す
  64.         if (!ini_get('safe_mode')) {
  65.             set_time_limit($max_execution_time);
  66.         }
  67.     }
  68. }
  69.  
  70. ?>

Documentation generated on Fri, 11 Nov 2011 04:01:13 +0900 by phpDocumentor 1.4.3