Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php |
— | — | @@ -11,30 +11,30 @@ |
12 | 12 | |
13 | 13 | class SeleniumTestSuite extends PHPUnit_Framework_TestSuite |
14 | 14 | { |
15 | | - private $selenium; |
| 15 | + private $selenium; |
16 | 16 | |
17 | | - public function setUp() |
18 | | - { |
| 17 | + public function setUp() |
| 18 | + { |
19 | 19 | |
20 | | - $this->selenium = Selenium::getInstance(); |
21 | | - $this->selenium->start(); |
22 | | - $this->login(); |
23 | | - //$this->loadPage('Testpage', 'edit'); |
24 | | - } |
| 20 | + $this->selenium = Selenium::getInstance(); |
| 21 | + $this->selenium->start(); |
| 22 | + $this->login(); |
| 23 | + //$this->loadPage('Testpage', 'edit'); |
| 24 | + } |
25 | 25 | |
26 | | - public function tearDown() |
27 | | - { |
28 | | - $this->selenium->stop(); |
29 | | - } |
| 26 | + public function tearDown() |
| 27 | + { |
| 28 | + $this->selenium->stop(); |
| 29 | + } |
30 | 30 | |
31 | | - public function login() |
32 | | - { |
33 | | - $this->selenium->login(); |
34 | | - } |
| 31 | + public function login() |
| 32 | + { |
| 33 | + $this->selenium->login(); |
| 34 | + } |
35 | 35 | |
36 | | - public function loadPage($title, $action) |
37 | | - { |
38 | | - $this->selenium->loadPage($title, $action); |
39 | | - } |
| 36 | + public function loadPage($title, $action) |
| 37 | + { |
| 38 | + $this->selenium->loadPage($title, $action); |
| 39 | + } |
40 | 40 | } |
41 | 41 | |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php |
— | — | @@ -6,37 +6,37 @@ |
7 | 7 | |
8 | 8 | class SeleniumTestCase extends PHPUnit_Framework_TestCase //PHPUnit_Extensions_SeleniumTestCase |
9 | 9 | { |
10 | | - protected $selenium; |
| 10 | + protected $selenium; |
11 | 11 | |
12 | | - public function setUp() |
13 | | - { |
14 | | - set_time_limit(60); |
15 | | - $this->selenium = Selenium::getInstance(); |
16 | | - //print_r($this->suite); |
17 | | - } |
| 12 | + public function setUp() |
| 13 | + { |
| 14 | + set_time_limit(60); |
| 15 | + $this->selenium = Selenium::getInstance(); |
| 16 | + //print_r($this->suite); |
| 17 | + } |
18 | 18 | |
19 | | - public function tearDown() |
20 | | - { |
| 19 | + public function tearDown() |
| 20 | + { |
21 | 21 | |
22 | | - } |
| 22 | + } |
23 | 23 | |
24 | | - public function __call($method, $args) |
25 | | - { |
26 | | - return call_user_func_array (array($this->selenium, $method), $args); |
27 | | - } |
| 24 | + public function __call($method, $args) |
| 25 | + { |
| 26 | + return call_user_func_array (array($this->selenium, $method), $args); |
| 27 | + } |
28 | 28 | |
29 | | - public function assertSeleniumAttributeEquals($attribute, $value) |
30 | | - { |
31 | | - $attr = $this->getAttribute($attribute); |
32 | | - $this->assertEquals($attr, $value); |
33 | | - } |
| 29 | + public function assertSeleniumAttributeEquals($attribute, $value) |
| 30 | + { |
| 31 | + $attr = $this->getAttribute($attribute); |
| 32 | + $this->assertEquals($attr, $value); |
| 33 | + } |
34 | 34 | |
35 | | - public function assertSeleniumHTMLContains($element, $text) |
36 | | - { |
37 | | - $innerHTML = $this->getText($element); |
38 | | - //or assertContains |
39 | | - $this->assertRegExp("/$text/", $innerHTML ); |
40 | | - } |
| 35 | + public function assertSeleniumHTMLContains($element, $text) |
| 36 | + { |
| 37 | + $innerHTML = $this->getText($element); |
| 38 | + //or assertContains |
| 39 | + $this->assertRegExp("/$text/", $innerHTML ); |
| 40 | + } |
41 | 41 | |
42 | 42 | } |
43 | 43 | |
Index: trunk/phase3/maintenance/tests/selenium/Selenium.php |
— | — | @@ -11,50 +11,50 @@ |
12 | 12 | |
13 | 13 | class Selenium extends Testing_Selenium |
14 | 14 | { |
15 | | - protected static $_instance = null; |
16 | | - public $isStarted = false; |
17 | | - public static function getInstance() |
18 | | - { |
19 | | - global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, $wgSeleniumTestsUseBrowser; |
20 | | - if (null === self::$_instance) |
21 | | - { |
22 | | - self::$_instance = new self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], $wgSeleniumTestsSeleniumHost); |
23 | | - } |
24 | | - return self::$_instance; |
25 | | - } |
| 15 | + protected static $_instance = null; |
| 16 | + public $isStarted = false; |
| 17 | + public static function getInstance() |
| 18 | + { |
| 19 | + global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, $wgSeleniumTestsUseBrowser; |
| 20 | + if (null === self::$_instance) |
| 21 | + { |
| 22 | + self::$_instance = new self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], $wgSeleniumTestsSeleniumHost); |
| 23 | + } |
| 24 | + return self::$_instance; |
| 25 | + } |
26 | 26 | |
27 | | - public function start() |
28 | | - { |
29 | | - global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost; |
30 | | - parent::start(); |
31 | | - $this->isStarted = true; |
32 | | - } |
| 27 | + public function start() |
| 28 | + { |
| 29 | + global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost; |
| 30 | + parent::start(); |
| 31 | + $this->isStarted = true; |
| 32 | + } |
33 | 33 | |
34 | | - public function stop() |
35 | | - { |
36 | | - parent::stop(); |
37 | | - $this->isStarted = false; |
38 | | - } |
| 34 | + public function stop() |
| 35 | + { |
| 36 | + parent::stop(); |
| 37 | + $this->isStarted = false; |
| 38 | + } |
39 | 39 | |
40 | | - public function login() |
41 | | - { |
42 | | - global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, $wgSeleniumTestsWikiUrl; |
| 40 | + public function login() |
| 41 | + { |
| 42 | + global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, $wgSeleniumTestsWikiUrl; |
43 | 43 | |
44 | | - $this->open($wgSeleniumTestsWikiUrl.'/index.php?title=Special:Userlogin'); |
45 | | - $this->type("wpName1", $wgSeleniumTestsWikiUser); |
46 | | - $this->type("wpPassword1", $wgSeleniumTestsWikiPassword); |
47 | | - $this->click("//input[@id='wpLoginAttempt']"); |
48 | | - $value = $this->doCommand('assertTitle', array('Anmeldung erfolgreich*')); |
49 | | - } |
| 44 | + $this->open($wgSeleniumTestsWikiUrl.'/index.php?title=Special:Userlogin'); |
| 45 | + $this->type("wpName1", $wgSeleniumTestsWikiUser); |
| 46 | + $this->type("wpPassword1", $wgSeleniumTestsWikiPassword); |
| 47 | + $this->click("//input[@id='wpLoginAttempt']"); |
| 48 | + $value = $this->doCommand('assertTitle', array('Anmeldung erfolgreich*')); |
| 49 | + } |
50 | 50 | |
51 | | - public function loadPage($title, $action) |
52 | | - { |
53 | | - global $wgSeleniumTestsWikiUrl; |
54 | | - $this->open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'&action='.$action); |
55 | | - } |
| 51 | + public function loadPage($title, $action) |
| 52 | + { |
| 53 | + global $wgSeleniumTestsWikiUrl; |
| 54 | + $this->open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'&action='.$action); |
| 55 | + } |
56 | 56 | |
57 | | - // Prevent external cloning |
58 | | - protected function __clone() {} |
59 | | - // Prevent external construction |
60 | | - //protected function __construct() {} |
| 57 | + // Prevent external cloning |
| 58 | + protected function __clone() {} |
| 59 | + // Prevent external construction |
| 60 | + //protected function __construct() {} |
61 | 61 | } |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestConsoleLogger.php |
— | — | @@ -6,24 +6,24 @@ |
7 | 7 | |
8 | 8 | class SeleniumTestConsoleLogger |
9 | 9 | { |
10 | | - public function __construct() |
11 | | - { |
12 | | - // Prepare testsuite for immediate output |
13 | | - @ini_set('zlib.output_compression', 0); |
14 | | - @ini_set('implicit_flush', 1); |
15 | | - for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
16 | | - ob_implicit_flush(1); |
17 | | - |
18 | | - } |
| 10 | + public function __construct() |
| 11 | + { |
| 12 | + // Prepare testsuite for immediate output |
| 13 | + @ini_set('zlib.output_compression', 0); |
| 14 | + @ini_set('implicit_flush', 1); |
| 15 | + for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
| 16 | + ob_implicit_flush(1); |
| 17 | + |
| 18 | + } |
19 | 19 | |
20 | | - public function write($message, $mode = false) |
21 | | - { |
22 | | - $out .= ''; |
23 | | - //if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '<font color="green">'; |
24 | | - $out .= htmlentities($message); |
25 | | - //if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '</font>'; |
26 | | - if ($mode != MW_TESTLOGGER_CONTINUE_LINE) $out .= "\n"; |
| 20 | + public function write($message, $mode = false) |
| 21 | + { |
| 22 | + $out .= ''; |
| 23 | + //if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '<font color="green">'; |
| 24 | + $out .= htmlentities($message); |
| 25 | + //if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '</font>'; |
| 26 | + if ($mode != MW_TESTLOGGER_CONTINUE_LINE) $out .= "\n"; |
27 | 27 | |
28 | | - echo $out; |
29 | | - } |
| 28 | + echo $out; |
| 29 | + } |
30 | 30 | } |
\ No newline at end of file |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestHTMLLogger.php |
— | — | @@ -6,38 +6,38 @@ |
7 | 7 | |
8 | 8 | class SeleniumTestHTMLLogger |
9 | 9 | { |
10 | | - public function __construct() |
11 | | - { |
12 | | - // Prepare testsuite for immediate output |
13 | | - @ini_set('zlib.output_compression', 0); |
14 | | - @ini_set('implicit_flush', 1); |
15 | | - for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
16 | | - ob_implicit_flush(1); |
17 | | - |
18 | | - // Output some style information |
19 | | - echo '<style> |
20 | | - pre { |
21 | | - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ |
22 | | - white-space: pre-wrap; /* css-3 */ |
23 | | - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ |
24 | | - white-space: -pre-wrap; /* Opera 4-6 */ |
25 | | - white-space: -o-pre-wrap; /* Opera 7 */ |
26 | | - /* width: 99%; */ |
27 | | - word-wrap: break-word; /* Internet Explorer 5.5+ */ |
28 | | - } |
29 | | - </style>'; |
30 | | - |
31 | | - |
32 | | - } |
| 10 | + public function __construct() |
| 11 | + { |
| 12 | + // Prepare testsuite for immediate output |
| 13 | + @ini_set('zlib.output_compression', 0); |
| 14 | + @ini_set('implicit_flush', 1); |
| 15 | + for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } |
| 16 | + ob_implicit_flush(1); |
| 17 | + |
| 18 | + // Output some style information |
| 19 | + echo '<style> |
| 20 | + pre { |
| 21 | + overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ |
| 22 | + white-space: pre-wrap; /* css-3 */ |
| 23 | + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ |
| 24 | + white-space: -pre-wrap; /* Opera 4-6 */ |
| 25 | + white-space: -o-pre-wrap; /* Opera 7 */ |
| 26 | + /* width: 99%; */ |
| 27 | + word-wrap: break-word; /* Internet Explorer 5.5+ */ |
| 28 | + } |
| 29 | + </style>'; |
| 30 | + |
| 31 | + |
| 32 | + } |
33 | 33 | |
34 | | - public function write($message, $mode = false) |
35 | | - { |
36 | | - $out .= ''; |
37 | | - if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '<font color="green">'; |
38 | | - $out .= htmlentities($message); |
39 | | - if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '</font>'; |
40 | | - if ($mode != MW_TESTLOGGER_CONTINUE_LINE) $out .= '<br/>'; |
| 34 | + public function write($message, $mode = false) |
| 35 | + { |
| 36 | + $out .= ''; |
| 37 | + if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '<font color="green">'; |
| 38 | + $out .= htmlentities($message); |
| 39 | + if ($mode == MW_TESTLOGGER_RESULT_OK) $out .= '</font>'; |
| 40 | + if ($mode != MW_TESTLOGGER_CONTINUE_LINE) $out .= '<br/>'; |
41 | 41 | |
42 | | - echo $out; |
43 | | - } |
| 42 | + echo $out; |
| 43 | + } |
44 | 44 | } |
\ No newline at end of file |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestListener.php |
— | — | @@ -6,69 +6,69 @@ |
7 | 7 | |
8 | 8 | class SeleniumTestListener implements PHPUnit_Framework_TestListener |
9 | 9 | { |
10 | | - private $logger; |
11 | | - private $tests_ok = 0; |
12 | | - private $tests_failed = 0; |
| 10 | + private $logger; |
| 11 | + private $tests_ok = 0; |
| 12 | + private $tests_failed = 0; |
13 | 13 | |
14 | | - public function __construct($loggerInstance) |
15 | | - { |
16 | | - $this->logger = $loggerInstance; |
17 | | - } |
| 14 | + public function __construct($loggerInstance) |
| 15 | + { |
| 16 | + $this->logger = $loggerInstance; |
| 17 | + } |
18 | 18 | |
19 | | - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) |
20 | | - { |
21 | | - $this->logger->write("Error: ".$e->getMessage()); |
22 | | - $this->tests_failed++; |
23 | | - } |
| 19 | + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) |
| 20 | + { |
| 21 | + $this->logger->write("Error: ".$e->getMessage()); |
| 22 | + $this->tests_failed++; |
| 23 | + } |
24 | 24 | |
25 | | - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) |
26 | | - { |
27 | | - $this->logger->write("Failed: ".$e->getMessage()); |
28 | | - $this->tests_failed++; |
| 25 | + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) |
| 26 | + { |
| 27 | + $this->logger->write("Failed: ".$e->getMessage()); |
| 28 | + $this->tests_failed++; |
29 | 29 | |
30 | | - } |
| 30 | + } |
31 | 31 | |
32 | | - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
33 | | - { |
34 | | - $this->logger->write("Incomplete."); |
35 | | - $this->tests_failed++; |
36 | | - } |
| 32 | + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
| 33 | + { |
| 34 | + $this->logger->write("Incomplete."); |
| 35 | + $this->tests_failed++; |
| 36 | + } |
37 | 37 | |
38 | | - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
39 | | - { |
40 | | - $this->logger->write("Skipped."); |
41 | | - $this->tests_failed++; |
42 | | - } |
| 38 | + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
| 39 | + { |
| 40 | + $this->logger->write("Skipped."); |
| 41 | + $this->tests_failed++; |
| 42 | + } |
43 | 43 | |
44 | | - public function startTest(PHPUnit_Framework_Test $test) |
45 | | - { |
46 | | - $this->logger->write("Testing ".$test->getName()." ... ", MW_TESTLOGGER_CONTINUE_LINE); |
47 | | - } |
| 44 | + public function startTest(PHPUnit_Framework_Test $test) |
| 45 | + { |
| 46 | + $this->logger->write("Testing ".$test->getName()." ... ", MW_TESTLOGGER_CONTINUE_LINE); |
| 47 | + } |
48 | 48 | |
49 | | - public function endTest(PHPUnit_Framework_Test $test, $time) |
50 | | - { |
51 | | - if (!$test->hasFailed()) |
52 | | - { |
53 | | - $this->logger->write("OK", MW_TESTLOGGER_RESULT_OK); |
54 | | - $this->tests_ok++; |
55 | | - } |
56 | | - } |
| 49 | + public function endTest(PHPUnit_Framework_Test $test, $time) |
| 50 | + { |
| 51 | + if (!$test->hasFailed()) |
| 52 | + { |
| 53 | + $this->logger->write("OK", MW_TESTLOGGER_RESULT_OK); |
| 54 | + $this->tests_ok++; |
| 55 | + } |
| 56 | + } |
57 | 57 | |
58 | | - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) |
59 | | - { |
60 | | - $this->logger->write("Testsuite ".$suite->getName()." started."); |
61 | | - $this->tests_ok = 0; |
62 | | - } |
| 58 | + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) |
| 59 | + { |
| 60 | + $this->logger->write("Testsuite ".$suite->getName()." started."); |
| 61 | + $this->tests_ok = 0; |
| 62 | + } |
63 | 63 | |
64 | | - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) |
65 | | - { |
66 | | - $this->logger->write("Testsuite ".$suite->getName()." ended. OK: ".$this->tests_ok." Failed: ".$this->tests_failed); |
| 64 | + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) |
| 65 | + { |
| 66 | + $this->logger->write("Testsuite ".$suite->getName()." ended. OK: ".$this->tests_ok." Failed: ".$this->tests_failed); |
67 | 67 | |
68 | | - } |
| 68 | + } |
69 | 69 | |
70 | | - public function statusMessage($message) |
71 | | - { |
72 | | - $this->logger->write($message); |
73 | | - } |
| 70 | + public function statusMessage($message) |
| 71 | + { |
| 72 | + $this->logger->write($message); |
| 73 | + } |
74 | 74 | } |
75 | 75 | |