From: Siebrand Mazeland Date: Fri, 15 Feb 2013 10:35:55 +0000 (+0100) Subject: Update formatting X-Git-Tag: 1.31.0-rc.0~20683 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=454d92fb7c09c49b4c8dc9a5324ab4c081caf8a3;p=lhc%2Fweb%2Fwiklou.git Update formatting 8 of n. Change-Id: I55551510e7afde5b6b981697d5c0efd7b9507585 --- diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php b/tests/phpunit/includes/upload/UploadFromUrlTest.php index a693cdb52f..4d2d8ce374 100644 --- a/tests/phpunit/includes/upload/UploadFromUrlTest.php +++ b/tests/phpunit/includes/upload/UploadFromUrlTest.php @@ -336,7 +336,7 @@ class UploadFromUrlTest extends ApiTestCase { */ protected function deleteFile( $name ) { $t = Title::newFromText( $name, NS_FILE ); - $this->assertTrue($t->exists(), "File '$name' exists"); + $this->assertTrue( $t->exists(), "File '$name' exists" ); if ( $t->exists() ) { $file = wfFindFile( $name, array( 'ignoreRedirect' => true ) ); @@ -347,6 +347,6 @@ class UploadFromUrlTest extends ApiTestCase { } $t = Title::newFromText( $name, NS_FILE ); - $this->assertFalse($t->exists(), "File '$name' was deleted"); + $this->assertFalse( $t->exists(), "File '$name' was deleted" ); } - } +} diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php index 857aef5c80..8fcaa21423 100644 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ b/tests/phpunit/includes/upload/UploadStashTest.php @@ -59,19 +59,19 @@ class UploadStashTest extends MediaWikiTestCase { } public function testValidRequest() { - $request = new FauxRequest( array( 'wpFileKey' => 'foo') ); - $this->assertFalse( UploadFromStash::isValidRequest($request), 'Check failure on bad wpFileKey' ); + $request = new FauxRequest( array( 'wpFileKey' => 'foo' ) ); + $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpFileKey' ); - $request = new FauxRequest( array( 'wpSessionKey' => 'foo') ); - $this->assertFalse( UploadFromStash::isValidRequest($request), 'Check failure on bad wpSessionKey' ); + $request = new FauxRequest( array( 'wpSessionKey' => 'foo' ) ); + $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpSessionKey' ); - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test') ); - $this->assertTrue( UploadFromStash::isValidRequest($request), 'Check good wpFileKey' ); + $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); + $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpFileKey' ); - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test') ); - $this->assertTrue( UploadFromStash::isValidRequest($request), 'Check good wpSessionKey' ); + $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); + $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpSessionKey' ); - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test', 'wpSessionKey' => 'foo') ); - $this->assertTrue( UploadFromStash::isValidRequest($request), 'Check key precedence' ); + $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test', 'wpSessionKey' => 'foo' ) ); + $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check key precedence' ); } } diff --git a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php b/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php index 58fcf16002..73d5dcc066 100644 --- a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php +++ b/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php @@ -31,19 +31,19 @@ class CLDRPluralRuleEvaluatorTest extends MediaWikiTestCase { array( 1, 'n is 1', 1.1, 'float number and is' ), array( 1, 'n is 1', 2, 'float number and is' ), - array( 0, 'n in 1,3,5', 3, '' ), + array( 0, 'n in 1,3,5', 3, '' ), array( 1, 'n not in 1,3,5', 5, '' ), - array( 1, 'n in 1,3,5', 2, '' ), + array( 1, 'n in 1,3,5', 2, '' ), array( 0, 'n not in 1,3,5', 4, '' ), - array( 0, 'n in 1..3', 2, '' ), - array( 0, 'n in 1..3', 3, 'in is inclusive' ), - array( 1, 'n in 1..3', 0, '' ), + array( 0, 'n in 1..3', 2, '' ), + array( 0, 'n in 1..3', 3, 'in is inclusive' ), + array( 1, 'n in 1..3', 0, '' ), - array( 1, 'n not in 1..3', 2, '' ), - array( 1, 'n not in 1..3', 3, 'in is inclusive' ), - array( 0, 'n not in 1..3', 0, '' ), + array( 1, 'n not in 1..3', 2, '' ), + array( 1, 'n not in 1..3', 3, 'in is inclusive' ), + array( 0, 'n not in 1..3', 0, '' ), array( 1, 'n is not 1 and n is not 2 and n is not 3', 1, 'and relation' ), array( 0, 'n is not 1 and n is not 2 and n is not 4', 3, 'and relation' ), diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index 106fab804c..40d24fc518 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -121,7 +121,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { protected function skipToNodeEnd( $name ) { while ( $this->xml->read() ) { if ( $this->xml->nodeType == XMLReader::END_ELEMENT && - $this->xml->name == $name ) { + $this->xml->name == $name + ) { return true; } } @@ -189,7 +190,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { protected function skipWhitespace() { $cont = true; while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE ) - || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) { + || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) { $cont = $this->xml->read(); } } @@ -300,7 +301,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * @param $parentid int|false: (optional) id of the parent revision */ protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false, - $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT ) { + $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT ) { $this->assertNodeStart( "revision" ); $this->skipWhitespace(); @@ -358,7 +359,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { $this->assertFalse( $this->xml->hasValue, "Revision has text" ); $this->assertTrue( $this->xml->read(), "Skipping text start tag" ); if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT ) - && ( $this->xml->name == "text" ) ) { + && ( $this->xml->name == "text" ) + ) { $this->xml->read(); } diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php index a029c92e7e..cc00e6e502 100644 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ b/tests/phpunit/maintenance/backupPrefetchTest.php @@ -265,12 +265,12 @@ class BaseDumpTest extends MediaWikiTestCase { foreach ( $requested_pages as $i ) { $this->assertTrue( array_key_exists( $i, $available_pages ), "Check for availability of requested page " . $i ); - $content .= $available_pages[ $i ]; + $content .= $available_pages[$i]; } $content .= $tail; $this->assertEquals( strlen( $content ), file_put_contents( - $fname, $content ), "Length of prepared prefetch" ); + $fname, $content ), "Length of prepared prefetch" ); return $fname; } diff --git a/tests/phpunit/maintenance/backup_LogTest.php b/tests/phpunit/maintenance/backup_LogTest.php index afd8f43730..5cf172e6aa 100644 --- a/tests/phpunit/maintenance/backup_LogTest.php +++ b/tests/phpunit/maintenance/backup_LogTest.php @@ -28,18 +28,18 @@ class BackupDumperLoggerTest extends DumpTestCase { * @return int id of the added log entry */ private function addLogEntry( $type, $subtype, User $user, $ns, $title, - $comment = null, $parameters = null ) { - - $logEntry = new ManualLogEntry( $type, $subtype ); + $comment = null, $parameters = null + ) { + $logEntry = new ManualLogEntry( $type, $subtype ); $logEntry->setPerformer( $user ); $logEntry->setTarget( Title::newFromText( $title, $ns ) ); - if ( $comment !== null ) { + if ( $comment !== null ) { $logEntry->setComment( $comment ); } - if ( $parameters !== null ) { + if ( $parameters !== null ) { $logEntry->setParameters( $parameters ); } - return $logEntry->insert(); + return $logEntry->insert(); } function addDBData() { @@ -73,7 +73,7 @@ class BackupDumperLoggerTest extends DumpTestCase { $this->logId3 = $this->addLogEntry( 'move', 'delete', $user2, NS_MAIN, "PageA", "SomeOtherComment", - array( 'key1' => 1, 3 => 'value3' ) ); + array( 'key1' => 1, 3 => 'value3' ) ); $this->assertGreaterThan( 0, $this->logId3 ); } catch ( Exception $e ) { @@ -101,7 +101,8 @@ class BackupDumperLoggerTest extends DumpTestCase { * @param $parameters array: (optional) unserialized data accompanying the log entry */ private function assertLogItem( $id, $user_name, $user_id, $comment, $type, - $subtype, $title, $parameters = array() ) { + $subtype, $title, $parameters = array() + ) { $this->assertNodeStart( "logitem" ); $this->skipWhitespace(); @@ -134,12 +135,12 @@ class BackupDumperLoggerTest extends DumpTestCase { $this->skipWhitespace(); } - function testPlain () { + function testPlain() { global $wgContLang; // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=file:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); $dumper->startId = $this->logId1; $dumper->endId = $this->logId3 + 1; $dumper->reporting = false; @@ -176,8 +177,8 @@ class BackupDumperLoggerTest extends DumpTestCase { // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=gzip:" . $fname, - "--reporting=2" ) ); + $dumper = new BackupDumper( array( "--output=gzip:" . $fname, + "--reporting=2" ) ); $dumper->startId = $this->logId1; $dumper->endId = $this->logId3 + 1; $dumper->setDb( $this->db ); diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index bcbf4ec121..2a0298a4a3 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -21,10 +21,10 @@ class PHPUnitMaintClass extends Maintenance { function __construct() { parent::__construct(); - $this->addOption( 'with-phpunitdir' - , 'Directory to include PHPUnit from, for example when using a git fetchout from upstream. Path will be prepended to PHP `include_path`.' - , false # not required - , true # need arg + $this->addOption( 'with-phpunitdir', + 'Directory to include PHPUnit from, for example when using a git fetchout from upstream. Path will be prepended to PHP `include_path`.', + false, # not required + true # need arg ); } @@ -49,26 +49,26 @@ class PHPUnitMaintClass extends Maintenance { // Assume UTC for testing purposes $wgLocaltimezone = 'UTC'; - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; + $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; } public function execute() { global $IP; # Make sure we have --configuration or PHPUnit might complain - if( !in_array( '--configuration', $_SERVER['argv'] ) ) { + if ( !in_array( '--configuration', $_SERVER['argv'] ) ) { //Hack to eliminate the need to use the Makefile (which sucks ATM) array_splice( $_SERVER['argv'], 1, 0, array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) ); } # --with-phpunitdir let us override the default PHPUnit version - if( $phpunitDir = $this->getOption( 'with-phpunitdir' ) ) { + if ( $phpunitDir = $this->getOption( 'with-phpunitdir' ) ) { # Sanity checks - if( !is_dir($phpunitDir) ) { + if ( !is_dir( $phpunitDir ) ) { $this->error( "--with-phpunitdir should be set to an existing directory", 1 ); } - if( !is_readable( $phpunitDir."/PHPUnit/Runner/Version.php" ) ) { + if ( !is_readable( $phpunitDir . "/PHPUnit/Runner/Version.php" ) ) { $this->error( "No usable PHPUnit installation in $phpunitDir.\nAborting.\n", 1 ); } @@ -80,8 +80,8 @@ class PHPUnitMaintClass extends Maintenance { # Cleanup $args array so the option and its value do not # pollute PHPUnit $key = array_search( '--with-phpunitdir', $_SERVER['argv'] ); - unset( $_SERVER['argv'][$key] ); // the option - unset( $_SERVER['argv'][$key+1] ); // its value + unset( $_SERVER['argv'][$key] ); // the option + unset( $_SERVER['argv'][$key + 1] ); // its value $_SERVER['argv'] = array_values( $_SERVER['argv'] ); } @@ -97,8 +97,9 @@ require( RUN_MAINTENANCE_IF_MAIN ); require_once( 'PHPUnit/Runner/Version.php' ); -if( PHPUnit_Runner_Version::id() !== '@package_version@' - && version_compare( PHPUnit_Runner_Version::id(), '3.6.7', '<' ) ) { +if ( PHPUnit_Runner_Version::id() !== '@package_version@' + && version_compare( PHPUnit_Runner_Version::id(), '3.6.7', '<' ) +) { die( 'PHPUnit 3.6.7 or later required, you have ' . PHPUnit_Runner_Version::id() . ".\n" ); } require_once( 'PHPUnit/Autoload.php' ); diff --git a/tests/phpunit/resources/ResourcesTest.php b/tests/phpunit/resources/ResourcesTest.php index 18db399239..71b8c676d3 100644 --- a/tests/phpunit/resources/ResourcesTest.php +++ b/tests/phpunit/resources/ResourcesTest.php @@ -62,7 +62,7 @@ class ResourcesTest extends MediaWikiTestCase { foreach ( $rl->getModuleNames() as $moduleName ) { $module = $rl->getModule( $moduleName ); - if ( ! $module instanceof ResourceLoaderFileModule ) { + if ( !$module instanceof ResourceLoaderFileModule ) { continue; } diff --git a/tests/phpunit/suites/ExtensionsTestSuite.php b/tests/phpunit/suites/ExtensionsTestSuite.php index d728807f17..eec773dbb3 100644 --- a/tests/phpunit/suites/ExtensionsTestSuite.php +++ b/tests/phpunit/suites/ExtensionsTestSuite.php @@ -1,4 +1,4 @@ -mDescription = 'Create a specification for message parsing ini JSON format'; - // add any other options here + parent::__construct(); + $this->mDescription = 'Create a specification for message parsing ini JSON format'; + // add any other options here } public function execute() { @@ -100,7 +100,7 @@ class GenerateJqueryMsgData extends Maintenance { $tests = array(); foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { foreach ( self::$keyToTestArgs as $key => $testArgs ) { - foreach ($testArgs as $args) { + foreach ( $testArgs as $args ) { // Get the raw message, without any transformations. $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); @@ -132,14 +132,14 @@ class GenerateJqueryMsgData extends Maintenance { $output = "// This file stores the output from the PHP parser for various messages, arguments,\n" - . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" - . "// through the object and comparing its parser return value with the 'result' property.\n" - . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" - // This file will contain unquoted JSON strings as javascript native object literals, - // flip the quotemark convention for this file. - . "/*jshint quotmark: double */\n" - . "\n" - . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; + . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" + . "// through the object and comparing its parser return value with the 'result' property.\n" + . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" + // This file will contain unquoted JSON strings as javascript native object literals, + // flip the quotemark convention for this file. + . "/*jshint quotmark: double */\n" + . "\n" + . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; $fp = file_put_contents( $dataSpecFile, $output ); if ( $fp === false ) { diff --git a/tests/qunit/data/qunitOkCall.js b/tests/qunit/data/qunitOkCall.js index 25c42d6a3b..3ed5514e78 100644 --- a/tests/qunit/data/qunitOkCall.js +++ b/tests/qunit/data/qunitOkCall.js @@ -1,2 +1,2 @@ QUnit.start(); -QUnit.assert.ok( true, 'Successfully loaded!'); +QUnit.assert.ok( true, 'Successfully loaded!' ); diff --git a/tests/qunit/data/styleTest.css.php b/tests/qunit/data/styleTest.css.php index 1870d5a38d..0e84581124 100644 --- a/tests/qunit/data/styleTest.css.php +++ b/tests/qunit/data/styleTest.css.php @@ -47,9 +47,9 @@ $wait = isset( $params['wait'] ) ? (int)$params['wait'] : 0; // seconds sleep( $wait ); -$css = " +$css = " /** - * Generated " . gmdate( 'r' ) . ". + * Generated " . gmdate( 'r' ) . ". * Waited {$wait}s. */ diff --git a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js b/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js index feeec559ad..e1895248f4 100644 --- a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js @@ -53,6 +53,6 @@ } else { assert.gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more)' ); } - }); + } ); }( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js b/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js index 378ea4b107..e4e579b063 100644 --- a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js @@ -2,7 +2,7 @@ QUnit.module( 'jquery.byteLength', QUnit.newMwEnvironment() ); QUnit.test( 'Simple text', 5, function ( assert ) { - var azLc = 'abcdefghijklmnopqrstuvwxyz', + var azLc = 'abcdefghijklmnopqrstuvwxyz', azUc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', num = '0123456789', x = '*', diff --git a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js b/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js index 51a892ed84..97e0533b26 100644 --- a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js @@ -24,7 +24,7 @@ assert.deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); assert.deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' ); assert.strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' ); - }); + } ); QUnit.test( 'rgbToHsl', 1, function ( assert ) { var hsl, ret; @@ -34,22 +34,23 @@ function dualDecimals( a ) { return Math.round( a * 100 ) / 100; } + // Re-create the rgbToHsl return array items, limited to two decimals. hsl = $.colorUtil.rgbToHsl( 144, 238, 144 ); ret = [ dualDecimals( hsl[0] ), dualDecimals( hsl[1] ), dualDecimals( hsl[2] ) ]; assert.deepEqual( ret, [0.33, 0.73, 0.75], 'rgb(144, 238, 144): hsl(0.33, 0.73, 0.75)' ); - }); + } ); QUnit.test( 'hslToRgb', 1, function ( assert ) { var rgb, ret; rgb = $.colorUtil.hslToRgb( 0.3, 0.7, 0.8 ); // Re-create the hslToRgb return array items, rounded to whole numbers. - ret = [ Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2]) ]; + ret = [ Math.round( rgb[0] ), Math.round( rgb[1] ), Math.round( rgb[2] ) ]; - assert.deepEqual( ret ,[183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' ); - }); + assert.deepEqual( ret, [183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' ); + } ); QUnit.test( 'getColorBrightness', 2, function ( assert ) { var a, b; @@ -58,5 +59,5 @@ b = $.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 ); assert.equal( b, 'rgb(118,29,29)', 'Start with rgb string "rgb(200,50,50)", darken 20%' ); - }); + } ); }( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js b/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js index 3e7d5ffce9..234b19cbde 100644 --- a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js @@ -1,37 +1,37 @@ ( function ( $ ) { - QUnit.asyncTest('jquery.delayedBind with data option', 2, function ( assert ) { - var $fixture = $('
').appendTo('#qunit-fixture'), + QUnit.asyncTest( 'jquery.delayedBind with data option', 2, function ( assert ) { + var $fixture = $( '
' ).appendTo( '#qunit-fixture' ), data = { magic: 'beeswax' }, delay = 50; - $fixture.delayedBind(delay, 'testevent', data, function ( e ) { - assert.ok( true, 'testevent fired'); - assert.ok( e.data === data, 'data is passed through delayedBind'); + $fixture.delayedBind( delay, 'testevent', data, function ( e ) { + assert.ok( true, 'testevent fired' ); + assert.ok( e.data === data, 'data is passed through delayedBind' ); QUnit.start(); - }); + } ); // We'll trigger it thrice, but it should only happen once. $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); - }); + } ); - QUnit.asyncTest('jquery.delayedBind without data option', 1, function ( assert ) { - var $fixture = $('
').appendTo('#qunit-fixture'), + QUnit.asyncTest( 'jquery.delayedBind without data option', 1, function ( assert ) { + var $fixture = $( '
' ).appendTo( '#qunit-fixture' ), delay = 50; - $fixture.delayedBind(delay, 'testevent', function () { - assert.ok(true, 'testevent fired'); + $fixture.delayedBind( delay, 'testevent', function () { + assert.ok( true, 'testevent fired' ); QUnit.start(); - }); + } ); // We'll trigger it thrice, but it should only happen once. $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); $fixture.trigger( 'testevent', {} ); - }); + } ); }( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js b/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js index 82566c2cb3..0b7e87ee21 100644 --- a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js @@ -2,7 +2,7 @@ QUnit.module( 'jquery.getAttrs', QUnit.newMwEnvironment() ); QUnit.test( 'Check', 1, function ( assert ) { - var attrs = { + var attrs = { foo: 'bar', 'class': 'lorem' }, diff --git a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js index d75c3789a6..140da384d9 100644 --- a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js @@ -4,7 +4,7 @@ QUnit.test( 'devicePixelRatio', function ( assert ) { var devicePixelRatio = $.devicePixelRatio(); assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' ); - }); + } ); QUnit.test( 'matchSrcSet', function ( assert ) { var srcset = 'onefive.png 1.5x, two.png 2x'; @@ -18,5 +18,5 @@ assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' ); assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' ); assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' ); - }); + } ); }( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.test.js b/tests/qunit/suites/resources/jquery/jquery.localize.test.js index 3810a042d0..d3877e055d 100644 --- a/tests/qunit/suites/resources/jquery/jquery.localize.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.localize.test.js @@ -132,4 +132,4 @@ assert.strictEqual( $lc.length, 1, 'link is created' ); assert.strictEqual( $lc.text(), 'link', 'the link text got added' ); } ); -}( jQuery, mediaWiki ) ) ; +}( jQuery, mediaWiki ) ); diff --git a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js index ec7179e8bc..2bed9b9fc2 100644 --- a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js +++ b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js @@ -23,6 +23,6 @@ assert.equal( $res.find( 'b' ).text(), 'Hello world', 'Bold tag wraps the entire, same, text' ); QUnit.start(); - }); - }); + } ); + } ); }( mediaWiki, jQuery ) ); diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js index 869ebe455b..7cfa46a0cb 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js @@ -1,6 +1,6 @@ ( function ( mw, $ ) { - QUnit.module( 'mediawiki.language', QUnit.newMwEnvironment({ + QUnit.module( 'mediawiki.language', QUnit.newMwEnvironment( { setup: function () { this.liveLangData = mw.language.data.values; mw.language.data.values = $.extend( true, {}, this.liveLangData ); @@ -8,12 +8,12 @@ teardown: function () { mw.language.data.values = this.liveLangData; } - }) ); + } ) ); QUnit.test( 'mw.language getData and setData', 2, function ( assert ) { mw.language.setData( 'en', 'testkey', 'testvalue' ); - assert.equal( mw.language.getData( 'en', 'testkey' ), 'testvalue', 'Getter setter test for mw.language' ); - assert.equal( mw.language.getData( 'en', 'invalidkey' ), undefined, 'Getter setter test for mw.language with invalid key' ); + assert.equal( mw.language.getData( 'en', 'testkey' ), 'testvalue', 'Getter setter test for mw.language' ); + assert.equal( mw.language.getData( 'en', 'invalidkey' ), undefined, 'Getter setter test for mw.language with invalid key' ); } ); function grammarTest( langCode, test ) { @@ -22,14 +22,14 @@ QUnit.test( 'Grammar test for lang=' + langCode, function ( assert ) { QUnit.expect( test.length ); - for ( var i = 0 ; i < test.length; i++ ) { + for ( var i = 0; i < test.length; i++ ) { assert.equal( mw.language.convertGrammar( test[i].word, test[i].grammarForm ), test[i].expected, test[i].description ); } - }); + } ); } var grammarTests = { @@ -390,5 +390,5 @@ if ( langCode === mw.config.get( 'wgUserLanguage' ) ) { grammarTest( langCode, test ); } - }); + } ); }( mediaWiki, jQuery ) ); diff --git a/tests/selenium/SeleniumConfig.php b/tests/selenium/SeleniumConfig.php index 04cf8d8857..0823275c17 100644 --- a/tests/selenium/SeleniumConfig.php +++ b/tests/selenium/SeleniumConfig.php @@ -10,14 +10,15 @@ class SeleniumConfig { * See sample config file in selenium_settings.ini.sample * */ - - public static function getSeleniumSettings ( &$seleniumSettings, - &$seleniumBrowsers, - &$seleniumTestSuites, - $seleniumConfigFile = null ) { + public static function getSeleniumSettings( &$seleniumSettings, + &$seleniumBrowsers, + &$seleniumTestSuites, + $seleniumConfigFile = null ) { if ( strlen( $seleniumConfigFile ) == 0 ) { global $wgSeleniumConfigFile; - if ( isset( $wgSeleniumConfigFile ) ) $seleniumConfigFile = $wgSeleniumConfigFile ; + if ( isset( $wgSeleniumConfigFile ) ) { + $seleniumConfigFile = $wgSeleniumConfigFile; + } } if ( strlen( $seleniumConfigFile ) == 0 || !file_exists( $seleniumConfigFile ) ) { @@ -29,7 +30,7 @@ class SeleniumConfig { throw new MWException( "Error parsing " . $seleniumConfigFile . "\n" ); } - if ( array_key_exists( 'SeleniumSettings', $configArray) ) { + if ( array_key_exists( 'SeleniumSettings', $configArray ) ) { wfSuppressWarnings(); //we may need to change how this is set. But for now leave it in the ini file $seleniumBrowsers = $configArray['SeleniumSettings']['browsers']; @@ -48,7 +49,7 @@ class SeleniumConfig { wfRestoreWarnings(); } - if ( array_key_exists( 'SeleniumTests', $configArray) ) { + if ( array_key_exists( 'SeleniumTests', $configArray ) ) { wfSuppressWarnings(); $seleniumTestSuites = $configArray['SeleniumTests']['testSuite']; wfRestoreWarnings(); diff --git a/tests/selenium/SeleniumTestListener.php b/tests/selenium/SeleniumTestListener.php index 9436f67271..dc0ac66c41 100644 --- a/tests/selenium/SeleniumTestListener.php +++ b/tests/selenium/SeleniumTestListener.php @@ -14,20 +14,17 @@ class SeleniumTestListener implements PHPUnit_Framework_TestListener { $this->tests_failed++; } - public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) - { + public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) { $this->logger->write( 'Failed: ' . $e->getMessage() ); $this->tests_failed++; } - public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) - { + public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { $this->logger->write( 'Incomplete.' ); $this->tests_failed++; } - public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) - { + public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { $this->logger->write( 'Skipped.' ); $this->tests_failed++; } @@ -53,7 +50,7 @@ class SeleniumTestListener implements PHPUnit_Framework_TestListener { } public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { - $this->logger->write('Testsuite ' . $suite->getName() . ' ended.' ); + $this->logger->write( 'Testsuite ' . $suite->getName() . ' ended.' ); if ( $this->tests_ok > 0 || $this->tests_failed > 0 ) { $this->logger->write( ' OK: ' . $this->tests_ok . ' Failed: ' . $this->tests_failed ); } diff --git a/tests/selenium/SeleniumTestSuite.php b/tests/selenium/SeleniumTestSuite.php index 81a630f8ae..6cbc1c78c5 100644 --- a/tests/selenium/SeleniumTestSuite.php +++ b/tests/selenium/SeleniumTestSuite.php @@ -25,7 +25,7 @@ abstract class SeleniumTestSuite extends PHPUnit_Framework_TestSuite { if ( $this->triggerClientTestResources ) { $this->selenium->open( $this->selenium->getUrl() . '/index.php?setupTestSuite=' . $this->getName() ); //wait a little longer for the db operation - $this->selenium->waitForPageToLoad( 6000 ); + $this->selenium->waitForPageToLoad( 6000 ); } if ( $this->loginBeforeTests ) { $this->login(); @@ -50,7 +50,7 @@ abstract class SeleniumTestSuite extends PHPUnit_Framework_TestSuite { protected function setLoginBeforeTests( $loginBeforeTests = true ) { $this->loginBeforeTests = $loginBeforeTests; } - + protected function setTriggerClientTestResources( $triggerClientTestResources = true ) { $this->triggerClientTestResources = $triggerClientTestResources; } diff --git a/tests/selenium/installer/MediaWikiInstallationConfig.php b/tests/selenium/installer/MediaWikiInstallationConfig.php index d86bcb8532..2663f65eb5 100644 --- a/tests/selenium/installer/MediaWikiInstallationConfig.php +++ b/tests/selenium/installer/MediaWikiInstallationConfig.php @@ -33,9 +33,9 @@ * with current value of the 'DB_NAME_PREFIX'. * If you wish to run the suite more than one time, you need to change * the value of the 'DB_NAME_PREFIX'. -*/ -define('DB_NAME_PREFIX', "database_name" ); -define('DIRECTORY_NAME', "mediawiki" ); + */ +define( 'DB_NAME_PREFIX', "database_name" ); +define( 'DIRECTORY_NAME', "mediawiki" ); define( 'PORT', "8080" ); define( 'HOST_NAME', "localhost" ); @@ -45,5 +45,5 @@ define( 'HOST_NAME', "localhost" ); * IE : *iexplore * Google chrome : *googlechrome * Opera : *opera -*/ + */ define ( 'TEST_BROWSER', "*firefox" ); diff --git a/tests/selenium/installer/MediaWikiInstallationMessage.php b/tests/selenium/installer/MediaWikiInstallationMessage.php index a348b542f8..f63c2ebff8 100644 --- a/tests/selenium/installer/MediaWikiInstallationMessage.php +++ b/tests/selenium/installer/MediaWikiInstallationMessage.php @@ -31,14 +31,14 @@ // 'MySQL' database type help field hint define( 'MYSQL_DATABASE_HOST_HELP', "If your database server is on different server, enter the host name or IP address here. \nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation. \nIf you are installing on a Windows server and using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address." ); define( 'MYSQL_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens. \nIf you are using shared web hosting, your hosting provider will either give you a specific database name to use or let you create databases via a control panel." ); -define( 'MYSQL_DATABASE_TABLE_PREFIX_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens."); +define( 'MYSQL_DATABASE_TABLE_PREFIX_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens." ); define( 'MYSQL_DATBASE_USERNAME_HELP', "Enter the username that will be used to connect to the database during the installation process. This is not the username of the MediaWiki account; this is the username for your database." ); define( 'MYSQL_DATABASE_PASSWORD_HELP', "Enter the password that will be used to connect to the database during the installation process. This is not the password for the MediaWiki account; this is the password for your database." ); // 'SQLite' database type help field hint define( 'SQLITE_DATA_DIRECTORY_HELP', "SQLite stores all data in a single file. \nThe directory you provide must be writable by the webserver during installation. \nIt should not be accessible via the web, this is why we're not putting it where your PHP files are. \nThe installer will write a .htaccess file along with it, but if that fails someone can gain access to your raw database. That includes raw user data (e-mail addresses, hashed passwords) as well as deleted revisions and other restricted data on the wiki. \nConsider putting the database somewhere else altogether, for example in /var/lib/mediawiki/yourwiki." ); -define( 'SQLITE_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. Do not use spaces or hyphens. This will be used for the SQLite data file name."); +define( 'SQLITE_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. Do not use spaces or hyphens. This will be used for the SQLite data file name." ); // 'Database settings' page hel0p field hint @@ -47,7 +47,7 @@ define( 'DATABASE_CHARACTER_SET_HELP', "In binary mode, MediaWiki stores UTF-8 t // 'Name' page help field hint -define( 'NAME_OF_WIKI_HELP', "This will appear in the title bar of the browser and in various other places."); +define( 'NAME_OF_WIKI_HELP', "This will appear in the title bar of the browser and in various other places." ); define( 'PROJECT_NAMESPACE_HELP', "Following Wikipedia's example, many wikis keep their policy pages separate from their content pages, in a \"project namespace\". All page titles in this namespace start with a certain prefix, which you can specify here. Traditionally, this prefix is derived from the name of the wiki, but it cannot contain punctuation characters such as \"#\" or \":\"." ); define( 'USER_NAME_HELP', "Enter your preferred username here, for example \"Joe Bloggs\". This is the name you will use to log in to the wiki." ); define( 'EMAIL_ADDRESS_HELP', "Enter an e-mail address here to allow you to receive e-mail from other users on the wiki, reset your password, and be notified of changes to pages on your watchlist." ); diff --git a/tests/selenium/installer/MediaWikiInstallationVariables.php b/tests/selenium/installer/MediaWikiInstallationVariables.php index bb11d02296..b271c7e004 100644 --- a/tests/selenium/installer/MediaWikiInstallationVariables.php +++ b/tests/selenium/installer/MediaWikiInstallationVariables.php @@ -29,12 +29,12 @@ // Common variables -define('PAGE_LOAD_TIME', "80000" ); +define( 'PAGE_LOAD_TIME', "80000" ); // Common links -define( 'LINK_DIV', "//div[@id='bodyContent']/div/div/"); +define( 'LINK_DIV', "//div[@id='bodyContent']/div/div/" ); define( 'LINK_FORM', "//div[@id='bodyContent']/div/div/div[2]/form/" ); -define( 'LINK_RIGHT_FRAMEWORK', "//div[@id='bodyContent']/div/div/div[1]/ul[1]/"); +define( 'LINK_RIGHT_FRAMEWORK', "//div[@id='bodyContent']/div/div/div[1]/ul[1]/" ); // 'Name' page input values define( 'NAME_OF_WIKI', "Site Name" ); @@ -48,30 +48,30 @@ define ( 'ADMIN_EMAIL_ADDRESS', "admin@example.com" ); define( 'VALID_WIKI_NAME', "MyWiki" ); define( 'VALID_YOUR_NAME', "FirstName LastName" ); define( 'VALID_PASSWORD', "12345" ); -define( 'VALID_PASSWORD_AGAIN', "12345" ); +define( 'VALID_PASSWORD_AGAIN', "12345" ); define( 'INVALID_PASSWORD_AGAIN', "123" ); -define( 'VALID_NAMESPACE', "Mynamespace" ); +define( 'VALID_NAMESPACE', "Mynamespace" ); define( 'INVALID_NAMESPACE', "##..##" ); // 'Database settings' page input values define( 'DB_WEB_USER', "different" ); -define('DB_WEB_USER_PASSWORD', "12345" ); +define( 'DB_WEB_USER_PASSWORD', "12345" ); // 'Connet to database' page input values -define( 'DATABASE_PREFIX',"databaseprefix" ); +define( 'DATABASE_PREFIX', "databaseprefix" ); // 'Connet to database' page input values for warning messages define( 'VALID_DB_HOST', "localhost" ); define( 'INVALID_DB_HOST', "local" ); define( 'INVALID_DB_NAME', "my-wiki" ); -define( 'VALID_DB_NAME', "my_wiki1"); +define( 'VALID_DB_NAME', "my_wiki1" ); define( 'INVALID_DB_PREFIX', "database prefix" ); -define( 'VALID_DB_PREFIX', "database_prefix"); +define( 'VALID_DB_PREFIX', "database_prefix" ); define( 'INVALID_DB_USER_NAME', "roots" ); -define( 'VALID_DB_USER_NAME', "root"); +define( 'VALID_DB_USER_NAME', "root" ); define( 'INVALID_DB_PASSWORD', "12345" ); diff --git a/tests/selenium/installer/MediaWikiInstallerTestSuite.php b/tests/selenium/installer/MediaWikiInstallerTestSuite.php index 58ccc7cdcd..03ffbfd273 100644 --- a/tests/selenium/installer/MediaWikiInstallerTestSuite.php +++ b/tests/selenium/installer/MediaWikiInstallerTestSuite.php @@ -44,10 +44,7 @@ require_once ( __DIR__ . '/MediaWikiDifferntDatabasePrefixTestCase.php' ); require_once ( __DIR__ . '/MediaWikiDifferentDatabaseAccountTestCase.php' ); require_once ( __DIR__ . '/MediaWikiOnAlreadyInstalledTestCase.php' ); - - - -$suite = new PHPUnit_Framework_TestSuite('ArrayTest'); +$suite = new PHPUnit_Framework_TestSuite( 'ArrayTest' ); $result = new PHPUnit_Framework_TestResult; -$suite->run($result); +$suite->run( $result ); diff --git a/tests/selenium/suites/MediaWikiEditorConfig.php b/tests/selenium/suites/MediaWikiEditorConfig.php index 072c3cb235..aeb2315d63 100644 --- a/tests/selenium/suites/MediaWikiEditorConfig.php +++ b/tests/selenium/suites/MediaWikiEditorConfig.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,21 +28,18 @@ */ class MediaWikiEditorConfig { - - public static function getSettings(&$includeFiles, &$globalConfigs) { - $includes = array( - //files that needed to be included would go here - //commenting out because this does not exist - //'tests/selenium/suites/MediaWikiCommonFunction.php' - ); - $configs = array( - 'wgPageLoadTime' => "600000" - ); - $includeFiles = array_merge( $includeFiles, $includes ); - $globalConfigs = array_merge( $globalConfigs, $configs); - return true; - } + public static function getSettings( &$includeFiles, &$globalConfigs ) { + $includes = array( + //files that needed to be included would go here + //commenting out because this does not exist + //'tests/selenium/suites/MediaWikiCommonFunction.php' + ); + $configs = array( + 'wgPageLoadTime' => "600000" + ); + $includeFiles = array_merge( $includeFiles, $includes ); + $globalConfigs = array_merge( $globalConfigs, $configs ); + return true; + } } - - diff --git a/tests/selenium/suites/MediaWikiExtraTestSuite.php b/tests/selenium/suites/MediaWikiExtraTestSuite.php index 5cd0a34969..8993907a0c 100644 --- a/tests/selenium/suites/MediaWikiExtraTestSuite.php +++ b/tests/selenium/suites/MediaWikiExtraTestSuite.php @@ -5,6 +5,7 @@ class MediaWikiExtraTestSuite extends SeleniumTestSuite { $this->setLoginBeforeTests( true ); parent::setUp(); } + public function addTests() { $testFiles = array( 'tests/selenium/suites/MyContributionsTestCase.php', diff --git a/tests/selenium/suites/MediawikiCoreSmokeTestCase.php b/tests/selenium/suites/MediawikiCoreSmokeTestCase.php index 6b8fc974b2..4491afd282 100644 --- a/tests/selenium/suites/MediawikiCoreSmokeTestCase.php +++ b/tests/selenium/suites/MediawikiCoreSmokeTestCase.php @@ -50,7 +50,8 @@ class MediawikiCoreSmokeTestCase extends SeleniumTestCase { $this->waitForPageToLoad( 30000 ); $this->assertSeleniumHTMLContains( - '//h1[@class="firstHeading"]', "Wikipedia-logo-v2-de.png" ); + '//h1[@class="firstHeading"]', "Wikipedia-logo-v2-de.png" + ); /* $this->open( $this->getUrl() . '/index.php?title=Image:' diff --git a/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php b/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php index a9a9b4d664..fc69e3c3fa 100644 --- a/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php +++ b/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php @@ -2,12 +2,12 @@ /** * Stubs for now. We're going to start populating this test. */ -class MediawikiCoreSmokeTestSuite extends SeleniumTestSuite -{ +class MediawikiCoreSmokeTestSuite extends SeleniumTestSuite { public function setUp() { $this->setLoginBeforeTests( false ); parent::setUp(); - } + } + public function addTests() { $testFiles = array( 'tests/selenium/suites/MediawikiCoreSmokeTestCase.php' diff --git a/tests/selenium/suites/PageDeleteTestSuite.php b/tests/selenium/suites/PageDeleteTestSuite.php index 256e35420d..e43ffa80fe 100644 --- a/tests/selenium/suites/PageDeleteTestSuite.php +++ b/tests/selenium/suites/PageDeleteTestSuite.php @@ -1,16 +1,15 @@ setLoginBeforeTests( true ); - parent::setUp(); - } - public function addTests() { - $testFiles = array( - 'tests/selenium/suites/DeletePageAdminTestCase.php' - ); - parent::addTestFiles( $testFiles ); - } - + public function setUp() { + $this->setLoginBeforeTests( true ); + parent::setUp(); + } + public function addTests() { + $testFiles = array( + 'tests/selenium/suites/DeletePageAdminTestCase.php' + ); + parent::addTestFiles( $testFiles ); + } } diff --git a/tests/selenium/suites/SimpleSeleniumTestCase.php b/tests/selenium/suites/SimpleSeleniumTestCase.php index b87172e6ed..14c9e6b991 100644 --- a/tests/selenium/suites/SimpleSeleniumTestCase.php +++ b/tests/selenium/suites/SimpleSeleniumTestCase.php @@ -24,7 +24,7 @@ class SimpleSeleniumTestCase extends SeleniumTestCase { public function testGlobalVariableForDefaultSkin() { $this->open( $this->getUrl() . '/index.php' ); $bodyClass = $this->getAttribute( "//body/@class" ); - $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set'); + $this->assertContains( 'skin-chick', $bodyClass, 'Chick skin not set' ); } /** @@ -33,7 +33,7 @@ class SimpleSeleniumTestCase extends SeleniumTestCase { public function testDatabaseResourceLoadedCorrectly() { $this->open( $this->getUrl() . '/index.php/TestResources?action=purge' ); $testString = $this->gettext( "//body//*[@id='firstHeading']" ); - $this-> assertEquals('TestResources', $testString, 'Article that should be present in the test db was not found.'); + $this->assertEquals( 'TestResources', $testString, 'Article that should be present in the test db was not found.' ); } } diff --git a/tests/selenium/suites/SimpleSeleniumTestSuite.php b/tests/selenium/suites/SimpleSeleniumTestSuite.php index 2e0c4ee251..446836a295 100644 --- a/tests/selenium/suites/SimpleSeleniumTestSuite.php +++ b/tests/selenium/suites/SimpleSeleniumTestSuite.php @@ -1,6 +1,6 @@ setLoginBeforeTests( false ); parent::setUp(); - } + } + public function addTests() { $testFiles = array( 'selenium/suites/SimpleSeleniumTestCase.php'