function __construct($bootstrap) { parent::__construct(); // autoload ALL packages if no custom bootstrap if (count($bootstrap) == 0) { foreach (glob(dirname(__FILE__) . '/*') as $dir) { $name = _end(array_filter(preg_split('@[/\\\\]@', $dir))); if (is_dir($dir) && ctype_alpha(substr($name, 0, 1))) { $rule = new T_Find_ClassInDir($dir, 'T_'); $this->addRule($rule); } } } else { foreach ($bootstrap as $dir) { if (is_dir($dir)) { $rule = new T_Find_ClassInDir($dir, 'T_'); $this->addRule($rule); } } // make sure unit package is autoloaded $this->addRule(new T_Find_ClassInDir(T_ROOT_DIR . 'unit', 'T_')); } // setup error handling $this->like('T_Exception_Handler')->append(new T_Exception_Handler_Terminal(E_ALL | E_STRICT)); }
function __construct() { parent::__construct(); // all classes required (reflection is needed) foreach (glob(dirname(__FILE__) . '/../*') as $dir) { $name = _end(array_filter(preg_split('@[/\\\\]@', $dir))); if (is_dir($dir) && ctype_alpha(substr($name, 0, 1))) { $rule = new T_Find_ClassInDir($dir, 'T_'); $this->addRule($rule); } } // setup error handling $this->like('T_Exception_Handler')->append(new T_Exception_Handler_Terminal(E_ALL | E_STRICT)); }