modified AutoloadBuilder for test exclusion
This commit is contained in:
@ -17,8 +17,11 @@
|
||||
class AutoloadBuilder
|
||||
{
|
||||
protected $autoload;
|
||||
|
||||
protected $dirs;
|
||||
|
||||
protected $handler;
|
||||
|
||||
protected $regex = '/(class|interface) ([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/';
|
||||
|
||||
public function __construct($autoload, $dirs = array())
|
||||
@ -41,7 +44,7 @@ class AutoloadBuilder
|
||||
foreach ($iterator as $file) {
|
||||
// skip non php files
|
||||
$e = explode('.', $file->getFileName());
|
||||
if ((end($e) !== 'php') || strstr($file->getFileName(), 'test')) {
|
||||
if ((end($e) !== 'php') || $this->rightSubstr($file->getFileName(), 8) == 'Test.php') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -86,4 +89,10 @@ class AutoloadBuilder
|
||||
}
|
||||
return (bool) fwrite($this->handler, $string);
|
||||
}
|
||||
|
||||
protected function rightSubstr($string, $nchars)
|
||||
{
|
||||
$right = substr($string, strlen($string) - $nchars, $nchars);
|
||||
return $right;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user