http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70323
Revision: 70323 Author: mglaser Date: 2010-08-02 08:09:26 +0000 (Mon, 02 Aug 2010) Log Message: ----------- * modified runTests to run suites instead of single tests. this fixes r70215 Modified Paths: -------------- trunk/phase3/includes/specials/SpecialSelenium.php Modified: trunk/phase3/includes/specials/SpecialSelenium.php =================================================================== --- trunk/phase3/includes/specials/SpecialSelenium.php 2010-08-02 08:07:52 UTC (rev 70322) +++ trunk/phase3/includes/specials/SpecialSelenium.php 2010-08-02 08:09:26 UTC (rev 70323) @@ -42,21 +42,24 @@ } function runTests() { - global $wgSeleniumTests, $wgOut; + global $wgSeleniumTestSuites, $wgOut, $wgSeleniumLogger; SeleniumLoader::load(); $result = new PHPUnit_Framework_TestResult; - $logger = new SeleniumTestHTMLLogger; - $result->addListener( new SeleniumTestListener( $logger ) ); - $logger->setHeaders(); + $wgSeleniumLogger = new SeleniumTestHTMLLogger; + $result->addListener( new SeleniumTestListener( $wgSeleniumLogger ) ); + //$wgSeleniumLogger->setHeaders(); // run tests - $suite = new SeleniumTestSuite; - foreach ( $wgSeleniumTests as $testClass ) { - $suite->addTest( new $testClass ); + $wgOut->addHTML( '<div class="selenium">' ); + + // for some really strange reason, foreach doesn't work here. It produces an infinite loop, + // executing only the first test suite. + for ( $i = 0; $i < count( $wgSeleniumTestSuites ); $i++ ) { + $suite = new $wgSeleniumTestSuites[$i]; + $suite->addTests(); + $suite->run( $result ); } - $wgOut->addHTML( '<div class="selenium">' ); - $suite->run( $result ); $wgOut->addHTML( '</div>' ); } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs