[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/utils/scripts/ -> test.php (source)

   1  <?php
   2  /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
   3  
   4  // +----------------------------------------------------------------------+
   5  // | Akelos Framework - http://www.akelos.org                             |
   6  // +----------------------------------------------------------------------+
   7  // | Copyright (c) 2002-2006, Akelos Media, S.L.  & Bermi Ferrer Martinez |
   8  // | Released under the GNU Lesser General Public License, see LICENSE.txt|
   9  // +----------------------------------------------------------------------+
  10  
  11  /**
  12   * @package ActiveSupport
  13   * @subpackage Scripts
  14   * @author Bermi Ferrer <bermi a.t akelos c.om>
  15   * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
  16   * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
  17   */
  18  
  19  if(preg_match('/^model/i', $argv[0])){
  20      array_shift($argv);
  21      foreach ($argv as $k=>$v){
  22          $argv[$k] = 'unit/app/models/'.AkInflector::underscore($v);
  23      }
  24  }elseif(preg_match('/^Ak[a-zA-Z]+/', $argv[0]) && is_dir(AK_BASE_DIR.DS.'test'.DS.'unit'.DS.'lib')){
  25      foreach ($argv as $k=>$v){
  26          $argv[$k] = 'unit/lib/'.$v;
  27      }
  28  }
  29  
  30  $____skip_tests = array('Simple','Unit','Web','AkWeb');
  31  
  32  foreach ($argv as $_test_file){
  33      $_test_file = strstr($_test_file,'.php') ? trim($_test_file, '/') : $_test_file.'.php';
  34      $_test_file = substr($_test_file,0,5) == 'test/' ? substr($_test_file,5) : $_test_file;
  35      $_test_file = $tests_dir.DIRECTORY_SEPARATOR.$_test_file;
  36      if(!file_exists($_test_file)){
  37          echo "\nCould not load $_test_file test file\n";
  38      }else{
  39          require($_test_file);
  40              foreach(get_declared_classes() as $____class){
  41                  if(preg_match('/(.+)TestCase$/i', $____class, $match)){
  42                      if(!preg_match('/^('.join('|',$____skip_tests).')$/i',$match[1])){
  43                          $____skip_tests[] = $match[1];
  44                          ak_test($match[1].'TestCase', true);
  45                      }
  46                  }
  47              }
  48          echo $_test_file."\n";
  49      }
  50  }
  51  
  52  
  53  
  54  
  55  ?>


Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6