Index: trunk/phase3/maintenance/tests/RunSeleniumTests.php |
— | — | @@ -1,49 +1,50 @@ |
2 | 2 | <?php |
3 | | - /** |
4 | | - * Copyright (C) Wikimedia Deuschland, 2009 |
5 | | - * Authors Hallo Welt! Medienwerkstatt GmbH |
6 | | - * Authors Markus Glaser |
7 | | - * |
8 | | - * This program is free software; you can redistribute it and/or modify |
9 | | - * it under the terms of the GNU General Public License as published by |
10 | | - * the Free Software Foundation; either version 2 of the License, or |
11 | | - * (at your option) any later version. |
12 | | - * |
13 | | - * This program is distributed in the hope that it will be useful, |
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | - * GNU General Public License for more details. |
17 | | - * |
18 | | - * You should have received a copy of the GNU General Public License along |
19 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
20 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
21 | | - * http://www.gnu.org/copyleft/gpl.html |
22 | | - * |
23 | | - */ |
| 3 | +/** |
| 4 | + * @file |
| 5 | + * @ingroup Maintenance |
| 6 | + * @copyright Copyright © Wikimedia Deuschland, 2009 |
| 7 | + * @author Hallo Welt! Medienwerkstatt GmbH |
| 8 | + * @author Markus Glaser |
| 9 | + * |
| 10 | + * This program is free software; you can redistribute it and/or modify |
| 11 | + * it under the terms of the GNU General Public License as published by |
| 12 | + * the Free Software Foundation; either version 2 of the License, or |
| 13 | + * (at your option) any later version. |
| 14 | + * |
| 15 | + * This program is distributed in the hope that it will be useful, |
| 16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | + * GNU General Public License for more details. |
| 19 | + * |
| 20 | + * You should have received a copy of the GNU General Public License along |
| 21 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 22 | + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 23 | + * http://www.gnu.org/copyleft/gpl.html |
| 24 | + */ |
24 | 25 | |
25 | | -define( "MEDIAWIKI", true ); |
26 | | -define( "SELENIUMTEST", true); |
| 26 | +define( 'MEDIAWIKI', true ); |
| 27 | +define( 'SELENIUMTEST', true ); |
27 | 28 | |
28 | | -//command line only |
| 29 | +// Command line only |
29 | 30 | $wgSeleniumTestsRunMode = 'cli'; |
30 | 31 | if( $wgSeleniumTestsRunMode == 'cli' && php_sapi_name() != 'cli' ) { |
31 | 32 | echo 'Must be run from the command line.'; |
32 | 33 | die( -1 ); |
33 | 34 | } |
34 | | -//include path and installation instructions |
| 35 | +// include path and installation instructions |
35 | 36 | |
36 | | -//URL: http://localhost/tests/RunSeleniumTests.php |
37 | | -//set_include_path(get_include_path() . PATH_SEPARATOR . './PEAR/'); |
| 37 | +// URL: http://localhost/tests/RunSeleniumTests.php |
| 38 | +//set_include_path( get_include_path() . PATH_SEPARATOR . './PEAR/' ); |
38 | 39 | |
39 | 40 | // Hostname of selenium server |
40 | | -$wgSeleniumTestsSeleniumHost = "http://localhost"; |
| 41 | +$wgSeleniumTestsSeleniumHost = 'http://localhost'; |
41 | 42 | |
42 | 43 | // URL of the wiki to be tested. |
43 | | -$wgSeleniumTestsWikiUrl = 'http://localhost'; |
| 44 | +$wgSeleniumTestsWikiUrl = 'http://localhost'; |
44 | 45 | |
45 | 46 | // Wiki login. Used by Selenium to log onto the wiki |
46 | | -$wgSeleniumTestsWikiUser = "WikiSysop"; |
47 | | -$wgSeleniumTestsWikiPassword = "password"; |
| 47 | +$wgSeleniumTestsWikiUser = 'WikiSysop'; |
| 48 | +$wgSeleniumTestsWikiPassword = 'password'; |
48 | 49 | |
49 | 50 | // Common browsers on Windows platform |
50 | 51 | // Use the *chrome handler in order to be able to test file uploads |
— | — | @@ -69,12 +70,16 @@ |
70 | 71 | require_once 'selenium/SeleniumTestCase.php'; |
71 | 72 | |
72 | 73 | $result = new PHPUnit_Framework_TestResult; |
73 | | -switch ($wgSeleniumTestsRunMode) { |
74 | | - case 'html' : $logger = new SeleniumTestHTMLLogger; break; |
75 | | - case 'cli' : $logger = new SeleniumTestConsoleLogger; break; |
| 74 | +switch ( $wgSeleniumTestsRunMode ) { |
| 75 | + case 'html': |
| 76 | + $logger = new SeleniumTestHTMLLogger; |
| 77 | + break; |
| 78 | + case 'cli': |
| 79 | + $logger = new SeleniumTestConsoleLogger; |
| 80 | + break; |
76 | 81 | } |
77 | | -$result->addListener(new SeleniumTestListener($logger)); |
78 | 82 | |
| 83 | +$result->addListener( new SeleniumTestListener( $logger ) ); |
79 | 84 | |
80 | 85 | $wgSeleniumTestSuites = array(); |
81 | 86 | |
— | — | @@ -82,12 +87,11 @@ |
83 | 88 | #include_once '<your tests>'; |
84 | 89 | |
85 | 90 | // Here, you can override standard setting |
86 | | -if (file_exists('LocalSeleniumSettings.php')) |
87 | | -{ |
| 91 | +if ( file_exists( 'LocalSeleniumSettings.php' ) ) { |
88 | 92 | include_once 'LocalSeleniumSettings.php'; |
89 | 93 | } |
90 | 94 | |
91 | 95 | // run tests |
92 | | -foreach ($wgSeleniumTestSuites as $suite) |
93 | | - $suite->run($result); |
94 | | -?> |
| 96 | +foreach ( $wgSeleniumTestSuites as $suite ) { |
| 97 | + $suite->run( $result ); |
| 98 | +} |
\ No newline at end of file |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php |
— | — | @@ -1,40 +1,34 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 3 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
4 | 4 | echo "This script cannot be run standalone"; |
5 | | - exit(1); |
| 5 | + exit( 1 ); |
6 | 6 | } |
7 | 7 | |
8 | 8 | // Do not add line break after test output |
9 | | -define('MW_TESTLOGGER_CONTINUE_LINE', 1); |
10 | | -define('MW_TESTLOGGER_RESULT_OK', 2); |
11 | | -define('MW_TESTLOGGER_RESULT_ERROR', 3); |
| 9 | +define( 'MW_TESTLOGGER_CONTINUE_LINE', 1 ); |
| 10 | +define( 'MW_TESTLOGGER_RESULT_OK', 2 ); |
| 11 | +define( 'MW_TESTLOGGER_RESULT_ERROR', 3 ); |
12 | 12 | |
13 | | -class SeleniumTestSuite extends PHPUnit_Framework_TestSuite |
14 | | -{ |
| 13 | +class SeleniumTestSuite extends PHPUnit_Framework_TestSuite { |
15 | 14 | private $selenium; |
16 | 15 | |
17 | | - public function setUp() |
18 | | - { |
19 | | - |
| 16 | + public function setUp() { |
20 | 17 | $this->selenium = Selenium::getInstance(); |
21 | 18 | $this->selenium->start(); |
22 | 19 | $this->login(); |
23 | | - //$this->loadPage('Testpage', 'edit'); |
| 20 | + //$this->loadPage( 'Testpage', 'edit' ); |
24 | 21 | } |
25 | 22 | |
26 | | - public function tearDown() |
27 | | - { |
| 23 | + public function tearDown() { |
28 | 24 | $this->selenium->stop(); |
29 | 25 | } |
30 | 26 | |
31 | | - public function login() |
32 | | - { |
| 27 | + public function login() { |
33 | 28 | $this->selenium->login(); |
34 | 29 | } |
35 | 30 | |
36 | | - public function loadPage($title, $action) |
37 | | - { |
38 | | - $this->selenium->loadPage($title, $action); |
| 31 | + public function loadPage( $title, $action ) { |
| 32 | + $this->selenium->loadPage( $title, $action ); |
39 | 33 | } |
40 | 34 | } |
41 | 35 | |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php |
— | — | @@ -1,43 +1,34 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 3 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
4 | 4 | echo "This script cannot be run standalone"; |
5 | | - exit(1); |
| 5 | + exit( 1 ); |
6 | 6 | } |
7 | 7 | |
8 | | -class SeleniumTestCase extends PHPUnit_Framework_TestCase //PHPUnit_Extensions_SeleniumTestCase |
9 | | -{ |
| 8 | +class SeleniumTestCase extends PHPUnit_Framework_TestCase { //PHPUnit_Extensions_SeleniumTestCase |
10 | 9 | protected $selenium; |
11 | 10 | |
12 | | - public function setUp() |
13 | | - { |
14 | | - set_time_limit(60); |
| 11 | + public function setUp() { |
| 12 | + set_time_limit( 60 ); |
15 | 13 | $this->selenium = Selenium::getInstance(); |
16 | | - //print_r($this->suite); |
17 | 14 | } |
18 | 15 | |
19 | | - public function tearDown() |
20 | | - { |
| 16 | + public function tearDown() { |
21 | 17 | |
22 | 18 | } |
23 | 19 | |
24 | | - public function __call($method, $args) |
25 | | - { |
26 | | - return call_user_func_array (array($this->selenium, $method), $args); |
| 20 | + public function __call( $method, $args ) { |
| 21 | + return call_user_func_array( array( $this->selenium, $method ), $args ); |
27 | 22 | } |
28 | 23 | |
29 | | - public function assertSeleniumAttributeEquals($attribute, $value) |
30 | | - { |
31 | | - $attr = $this->getAttribute($attribute); |
32 | | - $this->assertEquals($attr, $value); |
| 24 | + public function assertSeleniumAttributeEquals( $attribute, $value ) { |
| 25 | + $attr = $this->getAttribute( $attribute ); |
| 26 | + $this->assertEquals( $attr, $value ); |
33 | 27 | } |
34 | 28 | |
35 | | - public function assertSeleniumHTMLContains($element, $text) |
36 | | - { |
37 | | - $innerHTML = $this->getText($element); |
38 | | - //or assertContains |
39 | | - $this->assertRegExp("/$text/", $innerHTML ); |
| 29 | + public function assertSeleniumHTMLContains( $element, $text ) { |
| 30 | + $innerHTML = $this->getText( $element ); |
| 31 | + // or assertContains |
| 32 | + $this->assertRegExp( "/$text/", $innerHTML ); |
40 | 33 | } |
41 | 34 | |
42 | | -} |
43 | | - |
44 | | -?> |
| 35 | +} |
\ No newline at end of file |
Index: trunk/phase3/maintenance/tests/selenium/Selenium.php |
— | — | @@ -4,53 +4,47 @@ |
5 | 5 | * This is implemented as a singleton. |
6 | 6 | */ |
7 | 7 | |
8 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 8 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
9 | 9 | echo "This script cannot be run standalone"; |
10 | | - exit(1); |
| 10 | + exit( 1 ); |
11 | 11 | } |
12 | 12 | |
13 | | -class Selenium extends Testing_Selenium |
14 | | -{ |
| 13 | +class Selenium extends Testing_Selenium { |
15 | 14 | protected static $_instance = null; |
16 | 15 | public $isStarted = false; |
17 | | - public static function getInstance() |
18 | | - { |
| 16 | + |
| 17 | + public static function getInstance() { |
19 | 18 | global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, $wgSeleniumTestsUseBrowser; |
20 | | - if (null === self::$_instance) |
21 | | - { |
22 | | - self::$_instance = new self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], $wgSeleniumTestsSeleniumHost); |
| 19 | + if ( null === self::$_instance ) { |
| 20 | + self::$_instance = new self( $wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], $wgSeleniumTestsSeleniumHost ); |
23 | 21 | } |
24 | 22 | return self::$_instance; |
25 | 23 | } |
26 | 24 | |
27 | | - public function start() |
28 | | - { |
| 25 | + public function start() { |
29 | 26 | global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost; |
30 | 27 | parent::start(); |
31 | 28 | $this->isStarted = true; |
32 | 29 | } |
33 | 30 | |
34 | | - public function stop() |
35 | | - { |
| 31 | + public function stop() { |
36 | 32 | parent::stop(); |
37 | 33 | $this->isStarted = false; |
38 | 34 | } |
39 | 35 | |
40 | | - public function login() |
41 | | - { |
| 36 | + public function login() { |
42 | 37 | global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, $wgSeleniumTestsWikiUrl; |
43 | 38 | |
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*')); |
| 39 | + $this->open( $wgSeleniumTestsWikiUrl . '/index.php?title=Special:Userlogin' ); |
| 40 | + $this->type( 'wpName1', $wgSeleniumTestsWikiUser ); |
| 41 | + $this->type( 'wpPassword1', $wgSeleniumTestsWikiPassword ); |
| 42 | + $this->click( "//input[@id='wpLoginAttempt']" ); |
| 43 | + $value = $this->doCommand( 'assertTitle', array( 'Anmeldung erfolgreich*' ) ); |
49 | 44 | } |
50 | 45 | |
51 | | - public function loadPage($title, $action) |
52 | | - { |
| 46 | + public function loadPage( $title, $action ) { |
53 | 47 | global $wgSeleniumTestsWikiUrl; |
54 | | - $this->open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'&action='.$action); |
| 48 | + $this->open( $wgSeleniumTestsWikiUrl . '/index.php?title=' . $title . '&action=' . $action ); |
55 | 49 | } |
56 | 50 | |
57 | 51 | // Prevent external cloning |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestConsoleLogger.php |
— | — | @@ -1,28 +1,28 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 3 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
4 | 4 | echo "This script cannot be run standalone"; |
5 | | - exit(1); |
| 5 | + exit( 1 ); |
6 | 6 | } |
7 | 7 | |
8 | | -class SeleniumTestConsoleLogger |
9 | | -{ |
10 | | - public function __construct() |
11 | | - { |
| 8 | +class SeleniumTestConsoleLogger { |
| 9 | + public function __construct() { |
12 | 10 | // 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 | | - |
| 11 | + @ini_set( 'zlib.output_compression', 0 ); |
| 12 | + @ini_set( 'implicit_flush', 1 ); |
| 13 | + for ( $i = 0; $i < ob_get_level(); $i++ ) { |
| 14 | + ob_end_flush(); |
| 15 | + } |
| 16 | + ob_implicit_flush( 1 ); |
18 | 17 | } |
19 | 18 | |
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"; |
| 19 | + public function write( $message, $mode = false ) { |
| 20 | + $out = ''; |
| 21 | + //if ( $mode == MW_TESTLOGGER_RESULT_OK ) $out .= '<font color="green">'; |
| 22 | + $out .= htmlentities( $message ); |
| 23 | + //if ( $mode == MW_TESTLOGGER_RESULT_OK ) $out .= '</font>'; |
| 24 | + if ( $mode != MW_TESTLOGGER_CONTINUE_LINE ) { |
| 25 | + $out .= "\n"; |
| 26 | + } |
27 | 27 | |
28 | 28 | echo $out; |
29 | 29 | } |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestHTMLLogger.php |
— | — | @@ -1,42 +1,45 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 3 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
4 | 4 | echo "This script cannot be run standalone"; |
5 | | - exit(1); |
| 5 | + exit( 1 ); |
6 | 6 | } |
7 | 7 | |
8 | | -class SeleniumTestHTMLLogger |
9 | | -{ |
10 | | - public function __construct() |
11 | | - { |
| 8 | +class SeleniumTestHTMLLogger { |
| 9 | + public function __construct() { |
12 | 10 | // 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 | | - |
| 11 | + @ini_set( 'zlib.output_compression', 0 ); |
| 12 | + @ini_set( 'implicit_flush', 1 ); |
| 13 | + for ( $i = 0; $i < ob_get_level(); $i++ ) { |
| 14 | + ob_end_flush(); |
| 15 | + } |
| 16 | + ob_implicit_flush( 1 ); |
| 17 | + |
18 | 18 | // Output some style information |
19 | 19 | echo '<style> |
20 | 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+ */ |
| 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 | 28 | } |
29 | 29 | </style>'; |
30 | | - |
31 | | - |
32 | 30 | } |
33 | 31 | |
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/>'; |
| 32 | + public function write( $message, $mode = false ) { |
| 33 | + $out = ''; |
| 34 | + if ( $mode == MW_TESTLOGGER_RESULT_OK ) { |
| 35 | + $out .= '<font color="green">'; |
| 36 | + } |
| 37 | + $out .= htmlentities( $message ); |
| 38 | + if ( $mode == MW_TESTLOGGER_RESULT_OK ) { |
| 39 | + $out .= '</font>'; |
| 40 | + } |
| 41 | + if ( $mode != MW_TESTLOGGER_CONTINUE_LINE ) { |
| 42 | + $out .= '<br />'; |
| 43 | + } |
41 | 44 | |
42 | 45 | echo $out; |
43 | 46 | } |
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestListener.php |
— | — | @@ -1,74 +1,69 @@ |
2 | 2 | <?php |
3 | | -if (!defined('MEDIAWIKI') || !defined('SELENIUMTEST')) { |
| 3 | +if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) { |
4 | 4 | echo "This script cannot be run standalone"; |
5 | | - exit(1); |
| 5 | + exit( 1 ); |
6 | 6 | } |
7 | 7 | |
8 | | -class SeleniumTestListener implements PHPUnit_Framework_TestListener |
9 | | -{ |
| 8 | +class SeleniumTestListener implements PHPUnit_Framework_TestListener { |
10 | 9 | private $logger; |
11 | 10 | private $tests_ok = 0; |
12 | 11 | private $tests_failed = 0; |
13 | 12 | |
14 | | - public function __construct($loggerInstance) |
15 | | - { |
| 13 | + public function __construct( $loggerInstance ) { |
16 | 14 | $this->logger = $loggerInstance; |
17 | 15 | } |
18 | 16 | |
19 | | - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) |
20 | | - { |
21 | | - $this->logger->write("Error: ".$e->getMessage()); |
| 17 | + public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) { |
| 18 | + $this->logger->write( 'Error: ' . $e->getMessage() ); |
22 | 19 | $this->tests_failed++; |
23 | 20 | } |
24 | 21 | |
25 | | - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) |
| 22 | + public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) |
26 | 23 | { |
27 | | - $this->logger->write("Failed: ".$e->getMessage()); |
| 24 | + $this->logger->write( 'Failed: ' . $e->getMessage() ); |
28 | 25 | $this->tests_failed++; |
29 | | - |
30 | 26 | } |
31 | 27 | |
32 | | - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
| 28 | + public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) |
33 | 29 | { |
34 | | - $this->logger->write("Incomplete."); |
| 30 | + $this->logger->write( 'Incomplete.' ); |
35 | 31 | $this->tests_failed++; |
36 | 32 | } |
37 | 33 | |
38 | | - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
| 34 | + public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) |
39 | 35 | { |
40 | | - $this->logger->write("Skipped."); |
| 36 | + $this->logger->write( 'Skipped.' ); |
41 | 37 | $this->tests_failed++; |
42 | 38 | } |
43 | 39 | |
44 | | - public function startTest(PHPUnit_Framework_Test $test) |
45 | | - { |
46 | | - $this->logger->write("Testing ".$test->getName()." ... ", MW_TESTLOGGER_CONTINUE_LINE); |
| 40 | + public function startTest( PHPUnit_Framework_Test $test ) { |
| 41 | + $this->logger->write( |
| 42 | + 'Testing ' . $test->getName() . ' ... ', |
| 43 | + MW_TESTLOGGER_CONTINUE_LINE |
| 44 | + ); |
47 | 45 | } |
48 | 46 | |
49 | | - public function endTest(PHPUnit_Framework_Test $test, $time) |
50 | | - { |
51 | | - if (!$test->hasFailed()) |
52 | | - { |
53 | | - $this->logger->write("OK", MW_TESTLOGGER_RESULT_OK); |
| 47 | + public function endTest( PHPUnit_Framework_Test $test, $time ) { |
| 48 | + if ( !$test->hasFailed() ) { |
| 49 | + $this->logger->write( 'OK', MW_TESTLOGGER_RESULT_OK ); |
54 | 50 | $this->tests_ok++; |
55 | 51 | } |
56 | 52 | } |
57 | 53 | |
58 | | - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) |
59 | | - { |
60 | | - $this->logger->write("Testsuite ".$suite->getName()." started."); |
| 54 | + public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) { |
| 55 | + $this->logger->write( 'Testsuite ' . $suite->getName() . ' started.' ); |
61 | 56 | $this->tests_ok = 0; |
62 | 57 | } |
63 | 58 | |
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 | | - |
| 59 | + public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { |
| 60 | + $this->logger->write( |
| 61 | + 'Testsuite ' . $suite->getName() . ' ended. OK: ' . |
| 62 | + $this->tests_ok . ' Failed: ' . $this->tests_failed |
| 63 | + ); |
68 | 64 | } |
69 | 65 | |
70 | | - public function statusMessage($message) |
71 | | - { |
72 | | - $this->logger->write($message); |
| 66 | + public function statusMessage( $message ) { |
| 67 | + $this->logger->write( $message ); |
73 | 68 | } |
74 | 69 | } |
75 | 70 | |