[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/ -> AkUnitTestSuite.php (source)

   1  <?php
   2  require_once (AK_LIB_DIR.DS.'AkUnitTest.php');
   3  
   4  if (!defined('AK_UNIT_TEST_SUITE')) { define('AK_UNIT_TEST_SUITE',true);
   5  
   6  class AkUnitTestSuite extends GroupTest
   7  {
   8      var $baseDir = '';
   9      var $partial_tests = array();
  10      var $title = 'Akelos Tests';
  11  
  12      function AkUnitTestSuite()
  13      {
  14          $this->_init();
  15      }
  16      
  17      function _includeFiles($files)
  18      {
  19          foreach ($files as $test) {
  20              if (!is_dir($test)) {
  21                  if (!in_array($test,$this->excludes)) {
  22                      $this->addTestFile($test);
  23                  }
  24              } else {
  25                  $dirFiles = glob($test.DS.'*');
  26                  $this->_includeFiles($dirFiles);
  27              }
  28          }
  29      }
  30      function _init()
  31      {
  32          $base = AK_TEST_DIR.DS.'unit'.DS.'lib'.DS;
  33          $this->GroupTest($this->title);
  34          $allFiles = glob($base.$this->baseDir);
  35          if (isset($this->excludes)) {
  36              $excludes = array();
  37              $this->excludes = @Ak::toArray($this->excludes);
  38              foreach ($this->excludes as $pattern) {
  39                  $excludes = array_merge($excludes,glob($base.$pattern));
  40              }
  41              $this->excludes = $excludes;
  42          } else {
  43              $this->excludes = array();
  44          }
  45          if (count($allFiles)>=1 && $allFiles[0]!=$base.$this->baseDir && $this->partial_tests === true) {
  46              $this->_includeFiles($allFiles);
  47          } else if (is_array($this->partial_tests)){
  48              foreach ($this->partial_tests as $test) {
  49                  $this->addTestFile($base.$this->baseDir.DS.$test.'.php');
  50              }
  51          } else {
  52              echo "No files in : ".$this->title."\n";
  53  
  54          }
  55      }
  56  }
  57  
  58  }


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