Changeset 98
- Timestamp:
- 12/19/07 10:51:32 (13 months ago)
- Location:
- trunk/src/Stagehand/TestRunner
- Files:
-
- 2 modified
-
Common.php (modified) (4 diffs)
-
PHPSpec.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Stagehand/TestRunner/Common.php
r88 r98 66 66 protected $_suffix = 'TestCase'; 67 67 protected $_color; 68 protected $_includePattern; 68 69 69 70 /**#@-*/ … … 240 241 private function _exclude($class) 241 242 { 242 if ( strlen($this->_excludePattern) && preg_match($this->_excludePattern, $class)) {243 if (!is_null($this->_excludePattern) && preg_match($this->_excludePattern, $class)) { 243 244 return true; 244 245 } … … 297 298 } 298 299 300 if (!$this->_include($newClasses[$j])) { 301 continue; 302 } 303 299 304 $testCases[] = $newClasses[$j]; 300 305 print " => Added [ {$newClasses[$j]} ]\n"; … … 339 344 340 345 return $directories; 346 } 347 348 // }}} 349 // {{{ _include() 350 351 /** 352 * Returns whether the class should be include or not. 353 * 354 * @param string $class 355 * @return boolean 356 */ 357 private function _include($class) 358 { 359 if (!is_null($this->_includePattern) && preg_match($this->_includePattern, $class)) { 360 return true; 361 } 362 363 return is_subclass_of($class, $this->_baseClass); 341 364 } 342 365 -
trunk/src/Stagehand/TestRunner/PHPSpec.php
r93 r98 70 70 */ 71 71 72 protected $_excludePattern = '!^(PHPSpec_Context|Stagehand_TestRunner_PHPSpec_Context)$!';73 72 protected $_baseClass = 'PHPSpec_Context'; 74 73 protected $_suffix = 'Spec'; 74 protected $_includePattern = '!(^[Dd]escribe|[Ss]pec$)!'; 75 75 76 76 /**#@-*/
