summaryrefslogtreecommitdiff
path: root/tests/test_tools/functional_tests.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-09-22 22:39:41 +0200
committerFabio Bas <ctrlaltca@gmail.com>2013-09-22 22:39:41 +0200
commit7c65b2f40ea9242260eac5a746863f5925423861 (patch)
tree6c516057baa4356fde43f8d79517571bc8f0bfa2 /tests/test_tools/functional_tests.php
parent60c6bfa6f7caeb122cb8fa820506bdd1c54a842e (diff)
Phing: added target for phpunit+selenium
Functional tests were using an old selenium RC version. Ported them to use phpunit + selenium; next: opensauce
Diffstat (limited to 'tests/test_tools/functional_tests.php')
-rw-r--r--tests/test_tools/functional_tests.php69
1 files changed, 0 insertions, 69 deletions
diff --git a/tests/test_tools/functional_tests.php b/tests/test_tools/functional_tests.php
deleted file mode 100644
index 151f77db..00000000
--- a/tests/test_tools/functional_tests.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-$TEST_TOOLS = dirname(__FILE__);
-
-if(isset($_GET['sr']))
-{
- $selenium_base=$TEST_TOOLS.'/selenium/';
- $selenium_resource=realpath($selenium_base.$_GET['sr']);
-
- if($selenium_resource!==false &&
- strpos($selenium_resource, $selenium_base) === 0)
- echo file_get_contents($selenium_resource);
- exit;
-}
-
-require_once($TEST_TOOLS.'/simpletest/unit_tester.php');
-require_once($TEST_TOOLS.'/simpletest/web_tester.php');
-require_once($TEST_TOOLS.'/simpletest/mock_objects.php');
-require_once($TEST_TOOLS.'/simpletest/reporter.php');
-require_once($TEST_TOOLS.'/selenium/php/selenium.php');
-
-class PradoFunctionalTester
-{
- private $_name;
- private $_basePath;
- private $_selenium;
-
- public function __construct($basePath,$selenium='',$name='All Tests')
- {
- $this->_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);
- }
-}
-
-?> \ No newline at end of file