_name=$name; if($basePath==='' || ($this->_basePath=realpath($basePath))===false) throw new Exception('Invalid base path '.$basePath); $this->_basePath=strtr($this->_basePath,'\\','/'); $this->_selenium = $selenium.'selenium/'; } public function run($simpleReporter) { $server=SimpleSeleniumProxyServer::getInstance(dirname(__FILE__));//, '', $this->_selenium); $groupTest=new GroupTest($this->_name); $this->collectTestFiles($groupTest,$this->_basePath); $groupTest->run($simpleReporter); $server->handleRequest(); } protected function collectTestFiles($groupTest,$basePath) { $folder=@opendir($basePath); while($entry=@readdir($folder)) { $fullPath=strtr($basePath.'/'.$entry,'\\','/'); if(is_file($fullPath) && $this->isValidFile($entry)) $groupTest->addTestFile($fullPath); else if($entry[0]!=='.') $this->collectTestFiles($groupTest,$fullPath); } @closedir($folder); } protected function isValidFile($entry) { return preg_match('/\w+\.php$/',$entry); } } ?>