From 6ae6538555d45b3e947f5ce0d948d9b88d95364a Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 12 Mar 2006 16:28:21 +0000 Subject: reorganized FT. --- tests/FunctionalTests/PradoTester.php | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/FunctionalTests/PradoTester.php (limited to 'tests/FunctionalTests/PradoTester.php') diff --git a/tests/FunctionalTests/PradoTester.php b/tests/FunctionalTests/PradoTester.php new file mode 100644 index 00000000..8d081e0f --- /dev/null +++ b/tests/FunctionalTests/PradoTester.php @@ -0,0 +1,54 @@ +_name=$name; + if($basePath==='' || ($this->_basePath=realpath($basePath))===false) + throw new Exception('Invalid base path '.$basePath); + $this->_basePath=strtr($this->_basePath,'\\','/'); + } + + public function run($simpleReporter) + { + $groupTest=new GroupTest($this->_name); + $this->collectTestFiles($groupTest,$this->_basePath); + $groupTest->run($simpleReporter); + + $server=SimpleSeleniumProxyServer::getInstance(dirname(__FILE__)); + $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); + } +} + +?> \ No newline at end of file -- cgit v1.2.3