From: Siebrand Mazeland Date: Mon, 25 Mar 2013 23:27:14 +0000 (+0100) Subject: Update code formatting X-Git-Tag: 1.31.0-rc.0~20206 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=6da93fc6f696383585a3f1c4e69ba7994c01a0e5;p=lhc%2Fweb%2Fwiklou.git Update code formatting Also update some previous inconsistencies pointed out by Krinkle in change IDs: * Ide20743a2e84ff68549286120e6cff9d9f396f54 * I811ca957b6588085d67606ebc0cd4033a1e53839 Change-Id: Ife33b931870d0d7e04fcb40974997436d27f528f --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 7d95b077f1..ecc8ad1d47 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -438,7 +438,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * even if using different parameters. * * @param DatabaseBase $db The database connection - * @param String $prefix The prefix to use for the new table set (aka schema). + * @param String $prefix The prefix to use for the new table set (aka schema). * * @throws MWException if the database table prefix is already $prefix */ diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php index d4d93b07ab..ab93b2b6e9 100644 --- a/tests/phpunit/includes/LanguageConverterTest.php +++ b/tests/phpunit/includes/LanguageConverterTest.php @@ -85,7 +85,7 @@ class LanguageConverterTest extends MediaWikiLangTestCase { $wgUser->mFrom = 'defaults'; $wgUser->mOptionsLoaded = true; // The user's data is ignored because the variant is set in the URL. - $wgUser->setOption( 'variant', 'tg-latn' ); + $wgUser->setOption( 'variant', 'tg-latn' ); $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); } diff --git a/tests/phpunit/includes/PathRouterTest.php b/tests/phpunit/includes/PathRouterTest.php index 225918738f..9e50b4c251 100644 --- a/tests/phpunit/includes/PathRouterTest.php +++ b/tests/phpunit/includes/PathRouterTest.php @@ -151,18 +151,20 @@ class PathRouterTest extends MediaWikiTestCase { $router->add( array( 'qwerty' => "/qwerty/$1" ), array( 'qwerty' => '$key' ) ); $router->add( "/$2/$1", array( 'restricted-to-y' => '$2' ), array( '$2' => 'y' ) ); - foreach ( array( - '/Foo' => array( 'title' => 'Foo' ), - '/Bar' => array( 'ping' => 'pong' ), - '/Baz' => array( 'marco' => 'polo' ), - '/asdf-foo' => array( 'title' => 'qwerty-foo' ), - '/qwerty-bar' => array( 'title' => 'asdf-bar' ), - '/a/Foo' => array( 'title' => 'Foo' ), - '/asdf/Foo' => array( 'title' => 'Foo' ), - '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ), - '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ), - '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ), - ) as $path => $result ) { + foreach ( + array( + '/Foo' => array( 'title' => 'Foo' ), + '/Bar' => array( 'ping' => 'pong' ), + '/Baz' => array( 'marco' => 'polo' ), + '/asdf-foo' => array( 'title' => 'qwerty-foo' ), + '/qwerty-bar' => array( 'title' => 'asdf-bar' ), + '/a/Foo' => array( 'title' => 'Foo' ), + '/asdf/Foo' => array( 'title' => 'Foo' ), + '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ), + '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ), + '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ), + ) as $path => $result + ) { $this->assertEquals( $router->parse( $path ), $result ); } } diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php index a54a57e509..0530b4490c 100644 --- a/tests/phpunit/includes/StringUtilsTest.php +++ b/tests/phpunit/includes/StringUtilsTest.php @@ -29,7 +29,7 @@ class StringUtilsTest extends MediaWikiTestCase { */ function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) { $this->assertEquals( $expected, - StringUtils::isUtf8( $string, /** disable mbstring: */ true ), + StringUtils::isUtf8( $string, /** disable mbstring: */true ), 'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation' ); } @@ -116,7 +116,7 @@ class StringUtilsTest extends MediaWikiTestCase { array( $FAIL, "\xff" ), array( $FAIL, "\xfe\xfe\xff\xff" ), - /** + /* # The PHP implementation does not handle characters # being represented in a form which is too long :( @@ -133,7 +133,7 @@ class StringUtilsTest extends MediaWikiTestCase { array( $FAIL, "\xf0\x8F\xbf\xbf" ), array( $FAIL, "\xf8\x87\xbf\xbf" ), array( $FAIL, "\xfc\x83\xbf\xbf\xbf\xbf" ), - **/ + */ # non characters array( $PASS, "\xef\xbf\xbe" ), diff --git a/tests/phpunit/includes/api/ApiAccountCreationTest.php b/tests/phpunit/includes/api/ApiAccountCreationTest.php index 94082e5aff..696b145c15 100644 --- a/tests/phpunit/includes/api/ApiAccountCreationTest.php +++ b/tests/phpunit/includes/api/ApiAccountCreationTest.php @@ -65,8 +65,7 @@ class ApiCreateAccountTest extends ApiTestCase { 'action' => 'login', 'lgname' => 'Apitestnew', 'lgpassword' => $password, - ) - ); + ) ); $result = $ret[0]; $this->assertNotInternalType( 'bool', $result ); @@ -76,12 +75,14 @@ class ApiCreateAccountTest extends ApiTestCase { $this->assertEquals( 'NeedToken', $a ); $token = $result['login']['token']; - $ret = $this->doApiRequest( array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ), $ret[2] + $ret = $this->doApiRequest( + array( + 'action' => 'login', + 'lgtoken' => $token, + 'lgname' => 'Apitestnew', + 'lgpassword' => $password, + ), + $ret[2] ); $result = $ret[0]; @@ -92,9 +93,11 @@ class ApiCreateAccountTest extends ApiTestCase { $this->assertEquals( 'Success', $a ); // log out to destroy the session - $ret = $this->doApiRequest( array( - 'action' => 'logout', - ), $ret[2] + $ret = $this->doApiRequest( + array( + 'action' => 'logout', + ), + $ret[2] ); $this->assertEquals( array(), $ret[0] ); } diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php index 22770288b4..e278fd0e27 100644 --- a/tests/phpunit/includes/api/ApiTest.php +++ b/tests/phpunit/includes/api/ApiTest.php @@ -81,8 +81,7 @@ class ApiTest extends ApiTestCase { "action" => "login", "lgname" => $user->username, "lgpassword" => "bad", - ) - ); + ) ); $result = $ret[0]; @@ -136,7 +135,7 @@ class ApiTest extends ApiTestCase { $token = $result["login"]["token"]; $ret = $this->doApiRequest( - array( + array( "action" => "login", "lgtoken" => $token, "lgname" => $user->username, diff --git a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php index 6d4e3711df..30ec6c3558 100644 --- a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php @@ -67,7 +67,10 @@ class ApiQueryBasicTest extends ApiQueryTestBase { 'title' => 'AQBT-All', 'links' => array( array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) ) ) ) ); + ) + ) + ) ) + ); private static $templates = array( array( 'prop' => 'templates', 'titles' => 'AQBT-All' ), @@ -78,7 +81,10 @@ class ApiQueryBasicTest extends ApiQueryTestBase { 'title' => 'AQBT-All', 'templates' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) ) ) ) ); + ) + ) + ) ) + ); private static $categories = array( array( 'prop' => 'categories', 'titles' => 'AQBT-All' ), @@ -89,7 +95,10 @@ class ApiQueryBasicTest extends ApiQueryTestBase { 'title' => 'AQBT-All', 'categories' => array( array( 'ns' => 14, 'title' => 'Category:AQBT-Cat' ), - ) ) ) ) ); + ) + ) + ) ) + ); private static $allpages = array( array( 'list' => 'allpages', 'apprefix' => 'AQBT-' ), @@ -98,7 +107,8 @@ class ApiQueryBasicTest extends ApiQueryTestBase { array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), array( 'pageid' => 3, 'ns' => 0, 'title' => 'AQBT-Links' ), array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) ); + ) ) + ); private static $alllinks = array( array( 'list' => 'alllinks', 'alprefix' => 'AQBT-' ), @@ -107,40 +117,46 @@ class ApiQueryBasicTest extends ApiQueryTestBase { array( 'ns' => 0, 'title' => 'AQBT-Categories' ), array( 'ns' => 0, 'title' => 'AQBT-Links' ), array( 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) ); + ) ) + ); private static $alltransclusions = array( array( 'list' => 'alltransclusions', 'atprefix' => 'AQBT-' ), array( 'alltransclusions' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) ) ); + ) ) + ); private static $allcategories = array( array( 'list' => 'allcategories', 'acprefix' => 'AQBT-' ), array( 'allcategories' => array( array( '*' => 'AQBT-Cat' ), - ) ) ); + ) ) + ); private static $backlinks = array( array( 'list' => 'backlinks', 'bltitle' => 'AQBT-Links' ), array( 'backlinks' => array( array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - ) ) ); + ) ) + ); private static $embeddedin = array( array( 'list' => 'embeddedin', 'eititle' => 'Template:AQBT-T' ), array( 'embeddedin' => array( array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) ); + ) ) + ); private static $categorymembers = array( array( 'list' => 'categorymembers', 'cmtitle' => 'Category:AQBT-Cat' ), array( 'categorymembers' => array( array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), - ) ) ); + ) ) + ); private static $generatorAllpages = array( array( 'generator' => 'allpages', 'gapprefix' => 'AQBT-' ), @@ -161,7 +177,8 @@ class ApiQueryBasicTest extends ApiQueryTestBase { 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) ); + ) ) + ); private static $generatorLinks = array( array( 'generator' => 'links', 'titles' => 'AQBT-Links' ), @@ -178,14 +195,17 @@ class ApiQueryBasicTest extends ApiQueryTestBase { 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) ); + ) ) + ); private static $generatorLinksPropLinks = array( array( 'prop' => 'links' ), array( 'pages' => array( '1' => array( 'links' => array( array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) ) ) ) ); + ) ) + ) ) + ); private static $generatorLinksPropTemplates = array( array( 'prop' => 'templates' ), @@ -194,7 +214,8 @@ class ApiQueryBasicTest extends ApiQueryTestBase { array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), '4' => array( 'templates' => array( array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), - ) ) ); + ) ) + ); /** * Test basic props diff --git a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php b/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php index 0a3ac1da7c..c68065daed 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php @@ -48,7 +48,7 @@ class ApiQueryContinue2Test extends ApiQueryContinueTestBase { */ public function testA() { $this->mVerbose = false; - $mk = function( $g, $p, $gDir ) { + $mk = function ( $g, $p, $gDir ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT73462-', @@ -59,10 +59,10 @@ class ApiQueryContinue2Test extends ApiQueryContinueTestBase { ); }; // generator + 1 prop + 1 list - $data = $this->query( $mk(99,99,true), 1, 'g1p', false ); - $this->checkC( $data, $mk(1,1,true), 6, 'g1p-11t' ); - $this->checkC( $data, $mk(2,2,true), 3, 'g1p-22t' ); - $this->checkC( $data, $mk(1,1,false), 6, 'g1p-11f' ); - $this->checkC( $data, $mk(2,2,false), 3, 'g1p-22f' ); + $data = $this->query( $mk( 99, 99, true ), 1, 'g1p', false ); + $this->checkC( $data, $mk( 1, 1, true ), 6, 'g1p-11t' ); + $this->checkC( $data, $mk( 2, 2, true ), 3, 'g1p-22t' ); + $this->checkC( $data, $mk( 1, 1, false ), 6, 'g1p-11f' ); + $this->checkC( $data, $mk( 2, 2, false ), 3, 'g1p-22f' ); } } diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php b/tests/phpunit/includes/api/query/ApiQueryContinueTest.php index cb8f181285..33f46630a1 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTest.php @@ -58,21 +58,21 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function test1List() { $this->mVerbose = false; - $mk = function( $l ) { + $mk = function ( $l ) { return array( 'list' => 'allpages', 'apprefix' => 'AQCT-', 'aplimit' => "$l", ); }; - $data = $this->query( $mk(99), 1, '1L', false ); + $data = $this->query( $mk( 99 ), 1, '1L', false ); // 1 list - $this->checkC( $data, $mk(1), 5, '1L-1' ); - $this->checkC( $data, $mk(2), 3, '1L-2' ); - $this->checkC( $data, $mk(3), 2, '1L-3' ); - $this->checkC( $data, $mk(4), 2, '1L-4' ); - $this->checkC( $data, $mk(5), 1, '1L-5' ); + $this->checkC( $data, $mk( 1 ), 5, '1L-1' ); + $this->checkC( $data, $mk( 2 ), 3, '1L-2' ); + $this->checkC( $data, $mk( 3 ), 2, '1L-3' ); + $this->checkC( $data, $mk( 4 ), 2, '1L-4' ); + $this->checkC( $data, $mk( 5 ), 1, '1L-5' ); } /** @@ -81,7 +81,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function test2Lists() { $this->mVerbose = false; - $mk = function( $l1, $l2 ) { + $mk = function ( $l1, $l2 ) { return array( 'list' => 'allpages|alltransclusions', 'apprefix' => 'AQCT-', @@ -92,12 +92,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // 2 lists - $data = $this->query( $mk(99,99), 1, '2L', false ); - $this->checkC( $data, $mk(1,1), 5, '2L-11' ); - $this->checkC( $data, $mk(2,2), 3, '2L-22' ); - $this->checkC( $data, $mk(3,3), 2, '2L-33' ); - $this->checkC( $data, $mk(4,4), 2, '2L-44' ); - $this->checkC( $data, $mk(5,5), 1, '2L-55' ); + $data = $this->query( $mk( 99, 99 ), 1, '2L', false ); + $this->checkC( $data, $mk( 1, 1 ), 5, '2L-11' ); + $this->checkC( $data, $mk( 2, 2 ), 3, '2L-22' ); + $this->checkC( $data, $mk( 3, 3 ), 2, '2L-33' ); + $this->checkC( $data, $mk( 4, 4 ), 2, '2L-44' ); + $this->checkC( $data, $mk( 5, 5 ), 1, '2L-55' ); } /** @@ -106,7 +106,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function testGen1Prop() { $this->mVerbose = false; - $mk = function( $g, $p ) { + $mk = function ( $g, $p ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT-', @@ -116,12 +116,12 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 1 prop - $data = $this->query( $mk(99,99), 1, 'G1P', false ); - $this->checkC( $data, $mk(1,1), 11, 'G1P-11' ); - $this->checkC( $data, $mk(2,2), 6, 'G1P-22' ); - $this->checkC( $data, $mk(3,3), 4, 'G1P-33' ); - $this->checkC( $data, $mk(4,4), 3, 'G1P-44' ); - $this->checkC( $data, $mk(5,5), 2, 'G1P-55' ); + $data = $this->query( $mk( 99, 99 ), 1, 'G1P', false ); + $this->checkC( $data, $mk( 1, 1 ), 11, 'G1P-11' ); + $this->checkC( $data, $mk( 2, 2 ), 6, 'G1P-22' ); + $this->checkC( $data, $mk( 3, 3 ), 4, 'G1P-33' ); + $this->checkC( $data, $mk( 4, 4 ), 3, 'G1P-44' ); + $this->checkC( $data, $mk( 5, 5 ), 2, 'G1P-55' ); } /** @@ -130,7 +130,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function testGen2Prop() { $this->mVerbose = false; - $mk = function( $g, $p1, $p2 ) { + $mk = function ( $g, $p1, $p2 ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT-', @@ -141,17 +141,17 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 2 props - $data = $this->query( $mk(99,99,99), 1, 'G2P', false ); - $this->checkC( $data, $mk(1,1,1), 16, 'G2P-111' ); - $this->checkC( $data, $mk(2,2,2), 9, 'G2P-222' ); - $this->checkC( $data, $mk(3,3,3), 6, 'G2P-333' ); - $this->checkC( $data, $mk(4,4,4), 4, 'G2P-444' ); - $this->checkC( $data, $mk(5,5,5), 2, 'G2P-555' ); - $this->checkC( $data, $mk(5,1,1), 10, 'G2P-511' ); - $this->checkC( $data, $mk(4,2,2), 7, 'G2P-422' ); - $this->checkC( $data, $mk(2,3,3), 7, 'G2P-233' ); - $this->checkC( $data, $mk(2,4,4), 5, 'G2P-244' ); - $this->checkC( $data, $mk(1,5,5), 5, 'G2P-155' ); + $data = $this->query( $mk( 99, 99, 99 ), 1, 'G2P', false ); + $this->checkC( $data, $mk( 1, 1, 1 ), 16, 'G2P-111' ); + $this->checkC( $data, $mk( 2, 2, 2 ), 9, 'G2P-222' ); + $this->checkC( $data, $mk( 3, 3, 3 ), 6, 'G2P-333' ); + $this->checkC( $data, $mk( 4, 4, 4 ), 4, 'G2P-444' ); + $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G2P-555' ); + $this->checkC( $data, $mk( 5, 1, 1 ), 10, 'G2P-511' ); + $this->checkC( $data, $mk( 4, 2, 2 ), 7, 'G2P-422' ); + $this->checkC( $data, $mk( 2, 3, 3 ), 7, 'G2P-233' ); + $this->checkC( $data, $mk( 2, 4, 4 ), 5, 'G2P-244' ); + $this->checkC( $data, $mk( 1, 5, 5 ), 5, 'G2P-155' ); } /** @@ -160,7 +160,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function testGen1Prop1List() { $this->mVerbose = false; - $mk = function( $g, $p, $l ) { + $mk = function ( $g, $p, $l ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT-', @@ -174,24 +174,24 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 1 prop + 1 list - $data = $this->query( $mk(99,99,99), 1, 'G1P1L', false ); - $this->checkC( $data, $mk(1,1,1), 11, 'G1P1L-111' ); - $this->checkC( $data, $mk(2,2,2), 6, 'G1P1L-222' ); - $this->checkC( $data, $mk(3,3,3), 4, 'G1P1L-333' ); - $this->checkC( $data, $mk(4,4,4), 3, 'G1P1L-444' ); - $this->checkC( $data, $mk(5,5,5), 2, 'G1P1L-555' ); - $this->checkC( $data, $mk(5,5,1), 4, 'G1P1L-551' ); - $this->checkC( $data, $mk(5,5,2), 2, 'G1P1L-552' ); + $data = $this->query( $mk( 99, 99, 99 ), 1, 'G1P1L', false ); + $this->checkC( $data, $mk( 1, 1, 1 ), 11, 'G1P1L-111' ); + $this->checkC( $data, $mk( 2, 2, 2 ), 6, 'G1P1L-222' ); + $this->checkC( $data, $mk( 3, 3, 3 ), 4, 'G1P1L-333' ); + $this->checkC( $data, $mk( 4, 4, 4 ), 3, 'G1P1L-444' ); + $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G1P1L-555' ); + $this->checkC( $data, $mk( 5, 5, 1 ), 4, 'G1P1L-551' ); + $this->checkC( $data, $mk( 5, 5, 2 ), 2, 'G1P1L-552' ); } /** * Test smart continue - generator=allpages, prop=links|templates, - * list=alllinks|alltransclusions, meta=siteinfo + * list=alllinks|alltransclusions, meta=siteinfo * @medium */ public function testGen2Prop2List1Meta() { $this->mVerbose = false; - $mk = function( $g, $p1, $p2, $l1, $l2 ) { + $mk = function ( $g, $p1, $p2, $l1, $l2 ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT-', @@ -211,16 +211,16 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 1 prop + 1 list - $data = $this->query( $mk(99,99,99,99,99), 1, 'G2P2L1M', false ); - $this->checkC( $data, $mk(1,1,1,1,1), 16, 'G2P2L1M-11111' ); - $this->checkC( $data, $mk(2,2,2,2,2), 9, 'G2P2L1M-22222' ); - $this->checkC( $data, $mk(3,3,3,3,3), 6, 'G2P2L1M-33333' ); - $this->checkC( $data, $mk(4,4,4,4,4), 4, 'G2P2L1M-44444' ); - $this->checkC( $data, $mk(5,5,5,5,5), 2, 'G2P2L1M-55555' ); - $this->checkC( $data, $mk(5,5,5,1,1), 4, 'G2P2L1M-55511' ); - $this->checkC( $data, $mk(5,5,5,2,2), 2, 'G2P2L1M-55522' ); - $this->checkC( $data, $mk(5,1,1,5,5), 10, 'G2P2L1M-51155' ); - $this->checkC( $data, $mk(5,2,2,5,5), 5, 'G2P2L1M-52255' ); + $data = $this->query( $mk( 99, 99, 99, 99, 99 ), 1, 'G2P2L1M', false ); + $this->checkC( $data, $mk( 1, 1, 1, 1, 1 ), 16, 'G2P2L1M-11111' ); + $this->checkC( $data, $mk( 2, 2, 2, 2, 2 ), 9, 'G2P2L1M-22222' ); + $this->checkC( $data, $mk( 3, 3, 3, 3, 3 ), 6, 'G2P2L1M-33333' ); + $this->checkC( $data, $mk( 4, 4, 4, 4, 4 ), 4, 'G2P2L1M-44444' ); + $this->checkC( $data, $mk( 5, 5, 5, 5, 5 ), 2, 'G2P2L1M-55555' ); + $this->checkC( $data, $mk( 5, 5, 5, 1, 1 ), 4, 'G2P2L1M-55511' ); + $this->checkC( $data, $mk( 5, 5, 5, 2, 2 ), 2, 'G2P2L1M-55522' ); + $this->checkC( $data, $mk( 5, 1, 1, 5, 5 ), 10, 'G2P2L1M-51155' ); + $this->checkC( $data, $mk( 5, 2, 2, 5, 5 ), 5, 'G2P2L1M-52255' ); } /** @@ -229,7 +229,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function testSameGenAndProp() { $this->mVerbose = false; - $mk = function( $g, $gDir, $p, $pDir ) { + $mk = function ( $g, $gDir, $p, $pDir ) { return array( 'titles' => 'AQCT-1', 'generator' => 'templates', @@ -241,31 +241,31 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 1 prop - $data = $this->query( $mk(99,true,99,true), 1, 'G=P', false ); + $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=P', false ); - $this->checkC( $data, $mk(1,true,1,true), 4, 'G=P-1t1t' ); - $this->checkC( $data, $mk(2,true,2,true), 2, 'G=P-2t2t' ); - $this->checkC( $data, $mk(3,true,3,true), 2, 'G=P-3t3t' ); - $this->checkC( $data, $mk(1,true,3,true), 4, 'G=P-1t3t' ); - $this->checkC( $data, $mk(3,true,1,true), 2, 'G=P-3t1t' ); + $this->checkC( $data, $mk( 1, true, 1, true ), 4, 'G=P-1t1t' ); + $this->checkC( $data, $mk( 2, true, 2, true ), 2, 'G=P-2t2t' ); + $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=P-3t3t' ); + $this->checkC( $data, $mk( 1, true, 3, true ), 4, 'G=P-1t3t' ); + $this->checkC( $data, $mk( 3, true, 1, true ), 2, 'G=P-3t1t' ); - $this->checkC( $data, $mk(1,true,1,false), 4, 'G=P-1t1f' ); - $this->checkC( $data, $mk(2,true,2,false), 2, 'G=P-2t2f' ); - $this->checkC( $data, $mk(3,true,3,false), 2, 'G=P-3t3f' ); - $this->checkC( $data, $mk(1,true,3,false), 4, 'G=P-1t3f' ); - $this->checkC( $data, $mk(3,true,1,false), 2, 'G=P-3t1f' ); + $this->checkC( $data, $mk( 1, true, 1, false ), 4, 'G=P-1t1f' ); + $this->checkC( $data, $mk( 2, true, 2, false ), 2, 'G=P-2t2f' ); + $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=P-3t3f' ); + $this->checkC( $data, $mk( 1, true, 3, false ), 4, 'G=P-1t3f' ); + $this->checkC( $data, $mk( 3, true, 1, false ), 2, 'G=P-3t1f' ); - $this->checkC( $data, $mk(1,false,1,true), 4, 'G=P-1f1t' ); - $this->checkC( $data, $mk(2,false,2,true), 2, 'G=P-2f2t' ); - $this->checkC( $data, $mk(3,false,3,true), 2, 'G=P-3f3t' ); - $this->checkC( $data, $mk(1,false,3,true), 4, 'G=P-1f3t' ); - $this->checkC( $data, $mk(3,false,1,true), 2, 'G=P-3f1t' ); + $this->checkC( $data, $mk( 1, false, 1, true ), 4, 'G=P-1f1t' ); + $this->checkC( $data, $mk( 2, false, 2, true ), 2, 'G=P-2f2t' ); + $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=P-3f3t' ); + $this->checkC( $data, $mk( 1, false, 3, true ), 4, 'G=P-1f3t' ); + $this->checkC( $data, $mk( 3, false, 1, true ), 2, 'G=P-3f1t' ); - $this->checkC( $data, $mk(1,false,1,false), 4, 'G=P-1f1f' ); - $this->checkC( $data, $mk(2,false,2,false), 2, 'G=P-2f2f' ); - $this->checkC( $data, $mk(3,false,3,false), 2, 'G=P-3f3f' ); - $this->checkC( $data, $mk(1,false,3,false), 4, 'G=P-1f3f' ); - $this->checkC( $data, $mk(3,false,1,false), 2, 'G=P-3f1f' ); + $this->checkC( $data, $mk( 1, false, 1, false ), 4, 'G=P-1f1f' ); + $this->checkC( $data, $mk( 2, false, 2, false ), 2, 'G=P-2f2f' ); + $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=P-3f3f' ); + $this->checkC( $data, $mk( 1, false, 3, false ), 4, 'G=P-1f3f' ); + $this->checkC( $data, $mk( 3, false, 1, false ), 2, 'G=P-3f1f' ); } /** @@ -274,7 +274,7 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { */ public function testSameGenList() { $this->mVerbose = false; - $mk = function( $g, $gDir, $l, $pDir ) { + $mk = function ( $g, $gDir, $l, $pDir ) { return array( 'generator' => 'allpages', 'gapprefix' => 'AQCT-', @@ -287,27 +287,27 @@ class ApiQueryContinueTest extends ApiQueryContinueTestBase { ); }; // generator + 1 list - $data = $this->query( $mk(99,true,99,true), 1, 'G=L', false ); + $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=L', false ); - $this->checkC( $data, $mk(1,true,1,true), 5, 'G=L-1t1t' ); - $this->checkC( $data, $mk(2,true,2,true), 3, 'G=L-2t2t' ); - $this->checkC( $data, $mk(3,true,3,true), 2, 'G=L-3t3t' ); - $this->checkC( $data, $mk(1,true,3,true), 5, 'G=L-1t3t' ); - $this->checkC( $data, $mk(3,true,1,true), 5, 'G=L-3t1t' ); - $this->checkC( $data, $mk(1,true,1,false), 5, 'G=L-1t1f' ); - $this->checkC( $data, $mk(2,true,2,false), 3, 'G=L-2t2f' ); - $this->checkC( $data, $mk(3,true,3,false), 2, 'G=L-3t3f' ); - $this->checkC( $data, $mk(1,true,3,false), 5, 'G=L-1t3f' ); - $this->checkC( $data, $mk(3,true,1,false), 5, 'G=L-3t1f' ); - $this->checkC( $data, $mk(1,false,1,true), 5, 'G=L-1f1t' ); - $this->checkC( $data, $mk(2,false,2,true), 3, 'G=L-2f2t' ); - $this->checkC( $data, $mk(3,false,3,true), 2, 'G=L-3f3t' ); - $this->checkC( $data, $mk(1,false,3,true), 5, 'G=L-1f3t' ); - $this->checkC( $data, $mk(3,false,1,true), 5, 'G=L-3f1t' ); - $this->checkC( $data, $mk(1,false,1,false), 5, 'G=L-1f1f' ); - $this->checkC( $data, $mk(2,false,2,false), 3, 'G=L-2f2f' ); - $this->checkC( $data, $mk(3,false,3,false), 2, 'G=L-3f3f' ); - $this->checkC( $data, $mk(1,false,3,false), 5, 'G=L-1f3f' ); - $this->checkC( $data, $mk(3,false,1,false), 5, 'G=L-3f1f' ); + $this->checkC( $data, $mk( 1, true, 1, true ), 5, 'G=L-1t1t' ); + $this->checkC( $data, $mk( 2, true, 2, true ), 3, 'G=L-2t2t' ); + $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=L-3t3t' ); + $this->checkC( $data, $mk( 1, true, 3, true ), 5, 'G=L-1t3t' ); + $this->checkC( $data, $mk( 3, true, 1, true ), 5, 'G=L-3t1t' ); + $this->checkC( $data, $mk( 1, true, 1, false ), 5, 'G=L-1t1f' ); + $this->checkC( $data, $mk( 2, true, 2, false ), 3, 'G=L-2t2f' ); + $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=L-3t3f' ); + $this->checkC( $data, $mk( 1, true, 3, false ), 5, 'G=L-1t3f' ); + $this->checkC( $data, $mk( 3, true, 1, false ), 5, 'G=L-3t1f' ); + $this->checkC( $data, $mk( 1, false, 1, true ), 5, 'G=L-1f1t' ); + $this->checkC( $data, $mk( 2, false, 2, true ), 3, 'G=L-2f2t' ); + $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=L-3f3t' ); + $this->checkC( $data, $mk( 1, false, 3, true ), 5, 'G=L-1f3t' ); + $this->checkC( $data, $mk( 3, false, 1, true ), 5, 'G=L-3f1t' ); + $this->checkC( $data, $mk( 1, false, 1, false ), 5, 'G=L-1f1f' ); + $this->checkC( $data, $mk( 2, false, 2, false ), 3, 'G=L-2f2f' ); + $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=L-3f3f' ); + $this->checkC( $data, $mk( 1, false, 3, false ), 5, 'G=L-1f3f' ); + $this->checkC( $data, $mk( 3, false, 1, false ), 5, 'G=L-3f1f' ); } } diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php index 4717479646..e0a84e1a07 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php @@ -36,7 +36,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { /** * Run query() and compare against expected values */ - protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { + protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { $result = $this->query( $params, $expectedCount, $id, $continue ); $this->assertResult( $expected, $result, $id ); } @@ -52,7 +52,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { */ protected function query( $params, $expectedCount, $id, $useContinue = true ) { if ( isset( $params['action'] ) ) { - $this->assertEquals( 'query', $params['action'], 'Invalid query action'); + $this->assertEquals( 'query', $params['action'], 'Invalid query action' ); } else { $params['action'] = 'query'; } @@ -64,7 +64,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { $continue = array(); do { $request = array_merge( $params, $continue ); - uksort( $request, function( $a, $b ) { + uksort( $request, function ( $a, $b ) { // put 'continue' params at the end - lazy method $a = strpos( $a, 'continue' ) !== false ? 'zzz ' . $a : $a; $b = strpos( $b, 'continue' ) !== false ? 'zzz ' . $b : $b; @@ -74,7 +74,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { //$reqStr = str_replace( '&', ' & ', $reqStr ); $this->assertLessThan( $expectedCount, $count, "$id more data: $reqStr" ); if ( $this->mVerbose ) { - print ("$id (#$count): $reqStr\n"); + print ( "$id (#$count): $reqStr\n" ); } try { $data = $this->doApiRequest( $request ); @@ -107,48 +107,52 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { } elseif ( !$useContinue ) { $this->assertFalse( 'Non-smart query must be requested all at once' ); } - } while( true ); + } while ( true ); } private function printResult( $data ) { $q = $data['query']; $print = array(); - if (isset($q['pages'])) { - foreach ($q['pages'] as $p) { + if ( isset( $q['pages'] ) ) { + foreach ( $q['pages'] as $p ) { $m = $p['title']; - if (isset($p['links'])) { - $m .= '/[' . implode(',', array_map( - function ($v) { + if ( isset( $p['links'] ) ) { + $m .= '/[' . implode( ',', array_map( + function ( $v ) { return $v['title']; }, - $p['links'])) . ']'; + $p['links'] ) ) . ']'; } - if (isset($p['categories'])) { - $m .= '/(' . implode(',', array_map( - function ($v) { - return str_replace('Category:', '', $v['title']); + if ( isset( $p['categories'] ) ) { + $m .= '/(' . implode( ',', array_map( + function ( $v ) { + return str_replace( 'Category:', '', $v['title'] ); }, - $p['categories'])) . ')'; + $p['categories'] ) ) . ')'; } $print[] = $m; } } - if (isset($q['allcategories'])) { - $print[] = '*Cats/(' . implode(',', array_map( - function ($v) { return $v['*']; }, - $q['allcategories'])) . ')'; + if ( isset( $q['allcategories'] ) ) { + $print[] = '*Cats/(' . implode( ',', array_map( + function ( $v ) { + return $v['*']; + }, + $q['allcategories'] ) ) . ')'; } self::GetItems( $q, 'allpages', 'Pages', $print ); self::GetItems( $q, 'alllinks', 'Links', $print ); self::GetItems( $q, 'alltransclusions', 'Trnscl', $print ); - print(' ' . implode(' ', $print) . "\n"); + print( ' ' . implode( ' ', $print ) . "\n" ); } private static function GetItems( $q, $moduleName, $name, &$print ) { - if (isset($q[$moduleName])) { - $print[] = "*$name/[" . implode(',', - array_map( function ($v) { return $v['title']; }, - $q[$moduleName])) . ']'; + if ( isset( $q[$moduleName] ) ) { + $print[] = "*$name/[" . implode( ',', + array_map( function ( $v ) { + return $v['title']; + }, + $q[$moduleName] ) ) . ']'; } } @@ -164,12 +168,12 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { $this->assertEquals( $results, $newResult, 'Repeated result must be the same as before' ); } else { $sort = null; - foreach( $newResult as $key => $value ) { + foreach ( $newResult as $key => $value ) { if ( !$numericIds && $sort === null ) { if ( !is_array( $value ) ) { $sort = false; } elseif ( array_key_exists( 'title', $value ) ) { - $sort = function( $a, $b ) { + $sort = function ( $a, $b ) { return strcmp( $a['title'], $b['title'] ); }; } else { diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php index 7b9f8ede5a..3d96beb31f 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryTestBase.php @@ -43,7 +43,7 @@ STR; protected function merge( /*...*/ ) { $request = array(); $expected = array(); - foreach ( func_get_args() as $v ) { + foreach ( func_get_args() as $v ) { list( $req, $exp ) = $this->validateRequestExpectedPair( $v ); $request = array_merge_recursive( $request, $req ); $this->mergeExpected( $expected, $exp ); @@ -57,7 +57,7 @@ STR; */ private function validateRequestExpectedPair( $v ) { $this->assertType( 'array', $v, self::PARAM_ASSERT ); - $this->assertEquals( 2, count($v), self::PARAM_ASSERT ); + $this->assertEquals( 2, count( $v ), self::PARAM_ASSERT ); $this->assertArrayHasKey( 0, $v, self::PARAM_ASSERT ); $this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT ); $this->assertType( 'array', $v[0], self::PARAM_ASSERT ); @@ -71,7 +71,7 @@ STR; private function mergeExpected( &$all, $item ) { foreach ( $item as $k => $v ) { if ( array_key_exists( $k, $all ) ) { - if ( is_array ( $all[$k] ) ) { + if ( is_array( $all[$k] ) ) { $this->mergeExpected( $all[$k], $v ); } else { $this->assertEquals( $all[$k], $v ); diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index 3b3e4a656e..ada453c208 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -64,7 +64,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { global $wgContLang; $title = Title::newFromText( - ($lang == $wgContLang->getCode()) ? $title : "$title/$lang", + ( $lang == $wgContLang->getCode() ) ? $title : "$title/$lang", NS_MEDIAWIKI ); $wikiPage = new WikiPage( $title ); diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index ac8dcef17a..67d4fdea8e 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -257,8 +257,7 @@ class ContentHandlerTest extends MediaWikiTestCase { } catch ( MWException $ex ) { if ( !$shouldFail ) { $this->fail( "ContentHandler::makeContent failed unexpectedly: " . $ex->getMessage() ); - } - else { + } else { // dummy, so we don't get the "test did not perform any assertions" message. $this->assertTrue( true ); } diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 4eda827006..39611cbf21 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -36,7 +36,7 @@ class FileBackendTest extends MediaWikiTestCase { } } else { $this->singleBackend = new FSFileBackend( array( - 'name' => 'localtesting', + 'name' => 'localtesting', 'lockManager' => 'fsLockManager', #'parallelize' => 'implicit', 'containerPaths' => array( @@ -45,23 +45,23 @@ class FileBackendTest extends MediaWikiTestCase { ) ); } $this->multiBackend = new FileBackendMultiWrite( array( - 'name' => 'localtesting', + 'name' => 'localtesting', 'lockManager' => 'fsLockManager', 'parallelize' => 'implicit', - 'backends' => array( + 'backends' => array( array( - 'name' => 'localmultitesting1', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', + 'name' => 'localmultitesting1', + 'class' => 'FSFileBackend', + 'lockManager' => 'nullLockManager', 'containerPaths' => array( 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti1-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti1-cont2" ), 'isMultiMaster' => false ), array( - 'name' => 'localmultitesting2', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', + 'name' => 'localmultitesting2', + 'class' => 'FSFileBackend', + 'lockManager' => 'nullLockManager', 'containerPaths' => array( 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti2-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti2-cont2" ), @@ -823,7 +823,7 @@ class FileBackendTest extends MediaWikiTestCase { $status = $this->prepare( array( 'dir' => dirname( $path ) ) ); $this->assertGoodStatus( $status, "Preparing $path succeeded without warnings ($backendName)." ); - $createOps[] = array( 'op' => 'create', 'dst' => $path, 'content' => mt_rand(0, 50000) ); + $createOps[] = array( 'op' => 'create', 'dst' => $path, 'content' => mt_rand( 0, 50000 ) ); $copyOps[] = array( 'op' => 'copy', 'src' => $path, 'dst' => "$path-2" ); $moveOps[] = array( 'op' => 'move', 'src' => "$path-2", 'dst' => "$path-3" ); $purgeOps[] = array( 'op' => 'delete', 'src' => $path ); @@ -907,8 +907,8 @@ class FileBackendTest extends MediaWikiTestCase { foreach ( $srcs as $i => $source ) { $this->prepare( array( 'dir' => dirname( $source ) ) ); $ops[] = array( - 'op' => 'create', // operation - 'dst' => $source, // source + 'op' => 'create', // operation + 'dst' => $source, // source 'content' => $srcsContent[$i] ); $expContent .= $srcsContent[$i]; @@ -1868,7 +1868,9 @@ class FileBackendTest extends MediaWikiTestCase { } $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $iter ) {} // no errors + foreach ( $iter as $iter ) { + // no errors + } } public function testGetDirectoryList() { @@ -2065,7 +2067,10 @@ class FileBackendTest extends MediaWikiTestCase { } $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $file ) {} // no errors + foreach ( $iter as $file ) { + // no errors + } + $items = is_array( $iter ) ? $iter : iterator_to_array( $iter ); $this->assertEquals( array(), $items, "Directory listing is empty." ); @@ -2105,7 +2110,7 @@ class FileBackendTest extends MediaWikiTestCase { "subdir2/subdir/sub/120-px-file.txt", ); - for ( $i=0; $i<25; $i++ ) { + for ( $i = 0; $i < 25; $i++ ) { $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), "Locking of files succeeded ($backendName) ($i)." ); diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index 7d4b2bb336..a905f064e3 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -43,7 +43,7 @@ class JobQueueTest extends MediaWikiTestCase { foreach ( $variants as $q => $settings ) { try { $this->$q = JobQueue::factory( $settings + $baseConfig ); - if ( ! ( $this->$q instanceof JobQueueDB ) ) { + if ( !( $this->$q instanceof JobQueueDB ) ) { $this->$q->setTestingPrefix( 'unittests-' . wfRandomString( 32 ) ); } } catch ( MWException $e ) {}; // unsupported? (@TODO: what if it was another error?) @@ -52,10 +52,12 @@ class JobQueueTest extends MediaWikiTestCase { protected function tearDown() { parent::tearDown(); - foreach ( array( - 'queueRand', 'queueRandTTL', 'queueTimestamp', 'queueTimestampTTL', - 'queueFifo', 'queueFifoTTL' - ) as $q ) { + foreach ( + array( + 'queueRand', 'queueRandTTL', 'queueTimestamp', 'queueTimestampTTL', + 'queueFifo', 'queueFifoTTL' + ) as $q + ) { if ( $this->$q ) { do { $job = $this->$q->pop(); @@ -153,15 +155,16 @@ class JobQueueTest extends MediaWikiTestCase { $this->markTestSkipped( $desc ); } - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); $queue->flushCaches(); $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - $this->assertTrue( $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) ), + $this->assertTrue( + $queue->batchPush( + array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) + ), "Push worked ($desc)" ); $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); @@ -170,9 +173,12 @@ class JobQueueTest extends MediaWikiTestCase { $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - $this->assertTrue( $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) ), - "Push worked ($desc)" ); + $this->assertTrue( + $queue->batchPush( + array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) + ), + "Push worked ($desc)" + ); $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); @@ -206,7 +212,6 @@ class JobQueueTest extends MediaWikiTestCase { $this->markTestSkipped( $desc ); } - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); $queue->flushCaches(); @@ -260,7 +265,6 @@ class JobQueueTest extends MediaWikiTestCase { $this->markTestSkipped( $desc ); } - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); $queue->flushCaches(); diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/LanguageBe_taraskTest.php index 8bc908d04d..3fcc0e5834 100644 --- a/tests/phpunit/languages/LanguageBe_taraskTest.php +++ b/tests/phpunit/languages/LanguageBe_taraskTest.php @@ -34,7 +34,7 @@ class LanguageBe_taraskTest extends LanguageClassesTestCase { /** @dataProvider providePlural */ function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); + $forms = array( 'one', 'few', 'many', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } @@ -44,7 +44,7 @@ class LanguageBe_taraskTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'one', 1 ), array( 'many', 11 ), array( 'one', 91 ), @@ -61,7 +61,7 @@ class LanguageBe_taraskTest extends LanguageClassesTestCase { /** @dataProvider providePluralTwoForms */ function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); + $forms = array( 'one', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } diff --git a/tests/phpunit/languages/LanguageCsTest.php b/tests/phpunit/languages/LanguageCsTest.php index 06374d4999..93ee0f05a2 100644 --- a/tests/phpunit/languages/LanguageCsTest.php +++ b/tests/phpunit/languages/LanguageCsTest.php @@ -19,7 +19,7 @@ class LanguageCsTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'few', 2 ), diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php index a368371aa6..562d6d928a 100644 --- a/tests/phpunit/languages/LanguageCuTest.php +++ b/tests/phpunit/languages/LanguageCuTest.php @@ -9,7 +9,7 @@ class LanguageCuTest extends LanguageClassesTestCase { /** @dataProvider providePlural */ function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); + $forms = array( 'one', 'two', 'few', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } @@ -19,7 +19,7 @@ class LanguageCuTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'two', 2 ), diff --git a/tests/phpunit/languages/LanguageCyTest.php b/tests/phpunit/languages/LanguageCyTest.php index 221a49846f..435da4ff91 100644 --- a/tests/phpunit/languages/LanguageCyTest.php +++ b/tests/phpunit/languages/LanguageCyTest.php @@ -19,7 +19,7 @@ class LanguageCyTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'zero', 0 ), array( 'one', 1 ), array( 'two', 2 ), diff --git a/tests/phpunit/languages/LanguageGaTest.php b/tests/phpunit/languages/LanguageGaTest.php index da7cf12f48..73c4800393 100644 --- a/tests/phpunit/languages/LanguageGaTest.php +++ b/tests/phpunit/languages/LanguageGaTest.php @@ -19,7 +19,7 @@ class LanguageGaTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'two', 2 ), diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php index 4ff97ea871..edf8e50693 100644 --- a/tests/phpunit/languages/LanguageGdTest.php +++ b/tests/phpunit/languages/LanguageGdTest.php @@ -14,7 +14,7 @@ class LanguageGdTest extends LanguageClassesTestCase { } public static function providerPlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'two', 2 ), @@ -33,15 +33,15 @@ class LanguageGdTest extends LanguageClassesTestCase { } public static function providerPluralExplicit() { - return array ( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'Form11', 11 ), - array( 'Form12', 12 ), - array( 'few', 3 ), - array( 'few', 19 ), - array( 'other', 200 ), + return array( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'two', 2 ), + array( 'Form11', 11 ), + array( 'Form12', 12 ), + array( 'few', 3 ), + array( 'few', 19 ), + array( 'other', 200 ), ); } } diff --git a/tests/phpunit/languages/LanguageGvTest.php b/tests/phpunit/languages/LanguageGvTest.php index ef95c5f39b..71c0160aa9 100644 --- a/tests/phpunit/languages/LanguageGvTest.php +++ b/tests/phpunit/languages/LanguageGvTest.php @@ -11,7 +11,7 @@ class LanguageGvTest extends LanguageClassesTestCase { function testPlural( $result, $value ) { // This is not compatible with CLDR plural rules http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#gv // What does this mean? Is there a hard-coded override for gv somewhere? -Ryan Kaldari 2013-01-28 - $forms = array( 'Form 1', 'Form 2', 'Form 3', 'Form 4' ); + $forms = array( 'Form 1', 'Form 2', 'Form 3', 'Form 4' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } @@ -22,7 +22,7 @@ class LanguageGvTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'Form 4', 0 ), array( 'Form 2', 1 ), array( 'Form 3', 2 ), diff --git a/tests/phpunit/languages/LanguageHeTest.php b/tests/phpunit/languages/LanguageHeTest.php index 7849349aa1..a8524bbadc 100644 --- a/tests/phpunit/languages/LanguageHeTest.php +++ b/tests/phpunit/languages/LanguageHeTest.php @@ -43,7 +43,7 @@ class LanguageHeTest extends LanguageClassesTestCase { } public static function provideTwoPluralForms() { - return array ( + return array( array( 'other', 0 ), // Zero - plural array( 'one', 1 ), // Singular array( 'other', 2 ), // No third form provided, use it as plural @@ -54,7 +54,7 @@ class LanguageHeTest extends LanguageClassesTestCase { } public static function provideThreePluralForms() { - return array ( + return array( array( 'other', 0 ), // Zero - plural array( 'one', 1 ), // Singular array( 'two', 2 ), // Dual @@ -65,7 +65,7 @@ class LanguageHeTest extends LanguageClassesTestCase { } public static function provideFourPluralForms() { - return array ( + return array( array( 'other', 0 ), // Zero - plural array( 'one', 1 ), // Singular array( 'two', 2 ), // Dual @@ -83,31 +83,31 @@ class LanguageHeTest extends LanguageClassesTestCase { // The comments in the beginning of the line help avoid RTL problems // with text editors. public static function provideGrammar() { - return array ( + return array( array( - /* result */ 'וויקיפדיה', - /* word */ 'ויקיפדיה', - /* case */ 'תחילית', + /* result */'וויקיפדיה', + /* word */'ויקיפדיה', + /* case */'תחילית', ), array( - /* result */ 'וולפגנג', - /* word */ 'וולפגנג', - /* case */ 'prefixed', + /* result */'וולפגנג', + /* word */'וולפגנג', + /* case */'prefixed', ), array( - /* result */ 'קובץ', - /* word */ 'הקובץ', - /* case */ 'תחילית', + /* result */'קובץ', + /* word */'הקובץ', + /* case */'תחילית', ), array( - /* result */ '־Wikipedia', - /* word */ 'Wikipedia', - /* case */ 'תחילית', + /* result */'־Wikipedia', + /* word */'Wikipedia', + /* case */'תחילית', ), array( - /* result */ '־1995', - /* word */ '1995', - /* case */ 'תחילית', + /* result */'־1995', + /* word */'1995', + /* case */'תחילית', ), ); } diff --git a/tests/phpunit/languages/LanguageHrTest.php b/tests/phpunit/languages/LanguageHrTest.php index badfd112ef..7516bacb86 100644 --- a/tests/phpunit/languages/LanguageHrTest.php +++ b/tests/phpunit/languages/LanguageHrTest.php @@ -19,7 +19,7 @@ class LanguageHrTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'many', 0 ), array( 'one', 1 ), array( 'few', 2 ), diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php index f520b7e764..1abc375869 100644 --- a/tests/phpunit/languages/LanguageHyTest.php +++ b/tests/phpunit/languages/LanguageHyTest.php @@ -20,7 +20,7 @@ class LanguageHyTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'other', 2 ), diff --git a/tests/phpunit/languages/LanguageKshTest.php b/tests/phpunit/languages/LanguageKshTest.php index e863490f1e..291c59b41a 100644 --- a/tests/phpunit/languages/LanguageKshTest.php +++ b/tests/phpunit/languages/LanguageKshTest.php @@ -19,7 +19,7 @@ class LanguageKshTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'zero', 0 ), array( 'one', 1 ), array( 'other', 2 ), diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php index 45f083be2e..e5a10b5cc2 100644 --- a/tests/phpunit/languages/LanguageLtTest.php +++ b/tests/phpunit/languages/LanguageLtTest.php @@ -9,7 +9,7 @@ class LanguageLtTest extends LanguageClassesTestCase { /** @dataProvider providePlural */ function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); + $forms = array( 'one', 'few', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } @@ -19,7 +19,7 @@ class LanguageLtTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'few', 2 ), @@ -36,13 +36,13 @@ class LanguageLtTest extends LanguageClassesTestCase { /** @dataProvider providePluralTwoForms */ function testOneFewPlural( $result, $value ) { - $forms = array( 'one', 'other' ); + $forms = array( 'one', 'other' ); // This fails for 21, but not sure why. $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } public static function providePluralTwoForms() { - return array ( + return array( array( 'one', 1 ), array( 'other', 2 ), array( 'other', 15 ), diff --git a/tests/phpunit/languages/LanguageLvTest.php b/tests/phpunit/languages/LanguageLvTest.php index 3ff9589177..368ac8cf93 100644 --- a/tests/phpunit/languages/LanguageLvTest.php +++ b/tests/phpunit/languages/LanguageLvTest.php @@ -19,7 +19,7 @@ class LanguageLvTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'zero', 0 ), array( 'one', 1 ), array( 'other', 11 ), diff --git a/tests/phpunit/languages/LanguageMkTest.php b/tests/phpunit/languages/LanguageMkTest.php index 4ff2e3e81e..0ae533d2d8 100644 --- a/tests/phpunit/languages/LanguageMkTest.php +++ b/tests/phpunit/languages/LanguageMkTest.php @@ -19,7 +19,7 @@ class LanguageMkTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'other', 11 ), diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php index 3ffa4e773f..3b162b7b38 100644 --- a/tests/phpunit/languages/LanguageMoTest.php +++ b/tests/phpunit/languages/LanguageMoTest.php @@ -19,11 +19,11 @@ class LanguageMoTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), + return array( + array( 'few', 0 ), + array( 'one', 1 ), + array( 'few', 2 ), + array( 'few', 19 ), array( 'other', 20 ), array( 'other', 99 ), array( 'other', 100 ), diff --git a/tests/phpunit/languages/LanguageMtTest.php b/tests/phpunit/languages/LanguageMtTest.php index 350aa082c9..12af2e8843 100644 --- a/tests/phpunit/languages/LanguageMtTest.php +++ b/tests/phpunit/languages/LanguageMtTest.php @@ -19,13 +19,13 @@ class LanguageMtTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 10 ), - array( 'many', 11 ), - array( 'many', 19 ), + return array( + array( 'few', 0 ), + array( 'one', 1 ), + array( 'few', 2 ), + array( 'few', 10 ), + array( 'many', 11 ), + array( 'many', 19 ), array( 'other', 20 ), array( 'other', 99 ), array( 'other', 100 ), @@ -46,23 +46,23 @@ class LanguageMtTest extends LanguageClassesTestCase { } public static function providerPluralTwoForms() { - return array ( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'other', 101 ), - array( 'other', 102 ), - array( 'other', 110 ), - array( 'other', 111 ), - array( 'other', 119 ), - array( 'other', 120 ), - array( 'other', 201 ), + return array( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'other', 2 ), + array( 'other', 10 ), + array( 'other', 11 ), + array( 'other', 19 ), + array( 'other', 20 ), + array( 'other', 99 ), + array( 'other', 100 ), + array( 'other', 101 ), + array( 'other', 102 ), + array( 'other', 110 ), + array( 'other', 111 ), + array( 'other', 119 ), + array( 'other', 120 ), + array( 'other', 201 ), ); } } diff --git a/tests/phpunit/languages/LanguageNsoTest.php b/tests/phpunit/languages/LanguageNsoTest.php index 059de44947..1d62567fec 100644 --- a/tests/phpunit/languages/LanguageNsoTest.php +++ b/tests/phpunit/languages/LanguageNsoTest.php @@ -19,9 +19,9 @@ class LanguageNsoTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'one', 0 ), - array( 'one', 1 ), + return array( + array( 'one', 0 ), + array( 'one', 1 ), array( 'other', 2 ), ); } diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php index 837fc3a17c..9ec2a88e5d 100644 --- a/tests/phpunit/languages/LanguagePlTest.php +++ b/tests/phpunit/languages/LanguagePlTest.php @@ -19,23 +19,23 @@ class LanguagePlTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'many', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'many', 5 ), - array( 'many', 9 ), - array( 'many', 10 ), - array( 'many', 11 ), - array( 'many', 21 ), - array( 'few', 22 ), - array( 'few', 23 ), - array( 'few', 24 ), - array( 'many', 25 ), - array( 'many', 200 ), - array( 'many', 201 ), + return array( + array( 'many', 0 ), + array( 'one', 1 ), + array( 'few', 2 ), + array( 'few', 3 ), + array( 'few', 4 ), + array( 'many', 5 ), + array( 'many', 9 ), + array( 'many', 10 ), + array( 'many', 11 ), + array( 'many', 21 ), + array( 'few', 22 ), + array( 'few', 23 ), + array( 'few', 24 ), + array( 'many', 25 ), + array( 'many', 200 ), + array( 'many', 201 ), ); } @@ -46,23 +46,23 @@ class LanguagePlTest extends LanguageClassesTestCase { } public static function providerPluralTwoForms() { - return array ( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 4 ), - array( 'other', 5 ), - array( 'other', 9 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 21 ), - array( 'other', 22 ), - array( 'other', 23 ), - array( 'other', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - array( 'other', 201 ), + return array( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'other', 2 ), + array( 'other', 3 ), + array( 'other', 4 ), + array( 'other', 5 ), + array( 'other', 9 ), + array( 'other', 10 ), + array( 'other', 11 ), + array( 'other', 21 ), + array( 'other', 22 ), + array( 'other', 23 ), + array( 'other', 24 ), + array( 'other', 25 ), + array( 'other', 200 ), + array( 'other', 201 ), ); } } diff --git a/tests/phpunit/languages/LanguageRoTest.php b/tests/phpunit/languages/LanguageRoTest.php index 70324f59cf..919a744cd2 100644 --- a/tests/phpunit/languages/LanguageRoTest.php +++ b/tests/phpunit/languages/LanguageRoTest.php @@ -19,11 +19,11 @@ class LanguageRoTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), + return array( + array( 'few', 0 ), + array( 'one', 1 ), + array( 'few', 2 ), + array( 'few', 19 ), array( 'other', 20 ), array( 'other', 99 ), array( 'other', 100 ), diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index ccfda20aa1..bfd507486c 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -20,7 +20,7 @@ class LanguageRuTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'one', 1 ), array( 'many', 11 ), array( 'one', 91 ), @@ -37,7 +37,7 @@ class LanguageRuTest extends LanguageClassesTestCase { /** @dataProvider providePluralTwoForms */ function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); + $forms = array( 'one', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } diff --git a/tests/phpunit/languages/LanguageSeTest.php b/tests/phpunit/languages/LanguageSeTest.php index 9b9297c766..70efa3b913 100644 --- a/tests/phpunit/languages/LanguageSeTest.php +++ b/tests/phpunit/languages/LanguageSeTest.php @@ -19,7 +19,7 @@ class LanguageSeTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'two', 2 ), @@ -34,7 +34,7 @@ class LanguageSeTest extends LanguageClassesTestCase { } public static function providerPluralTwoForms() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'other', 2 ), diff --git a/tests/phpunit/languages/LanguageShTest.php b/tests/phpunit/languages/LanguageShTest.php index 8dd18ea55e..9f34db5a7f 100644 --- a/tests/phpunit/languages/LanguageShTest.php +++ b/tests/phpunit/languages/LanguageShTest.php @@ -19,9 +19,9 @@ class LanguageShTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'many', 0 ), - array( 'one', 1 ), + array( 'one', 1 ), array( 'few', 2 ), array( 'few', 4 ), array( 'many', 5 ), diff --git a/tests/phpunit/languages/LanguageSkTest.php b/tests/phpunit/languages/LanguageSkTest.php index da09b563b9..3f32c66b69 100644 --- a/tests/phpunit/languages/LanguageSkTest.php +++ b/tests/phpunit/languages/LanguageSkTest.php @@ -20,7 +20,7 @@ class LanguageSkTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'few', 2 ), diff --git a/tests/phpunit/languages/LanguageSlTest.php b/tests/phpunit/languages/LanguageSlTest.php index 8329791427..84c2e01ec8 100644 --- a/tests/phpunit/languages/LanguageSlTest.php +++ b/tests/phpunit/languages/LanguageSlTest.php @@ -20,12 +20,12 @@ class LanguageSlTest extends LanguageClassesTestCase { } public static function providerPlural() { - return array ( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), + return array( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'two', 2 ), + array( 'few', 3 ), + array( 'few', 4 ), array( 'other', 5 ), array( 'other', 99 ), array( 'other', 100 ), diff --git a/tests/phpunit/languages/LanguageSmaTest.php b/tests/phpunit/languages/LanguageSmaTest.php index 2eb811367c..58198317ac 100644 --- a/tests/phpunit/languages/LanguageSmaTest.php +++ b/tests/phpunit/languages/LanguageSmaTest.php @@ -19,7 +19,7 @@ class LanguageSmaTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'two', 2 ), @@ -34,7 +34,7 @@ class LanguageSmaTest extends LanguageClassesTestCase { } public static function providerPluralTwoForms() { - return array ( + return array( array( 'other', 0 ), array( 'one', 1 ), array( 'other', 2 ), diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php index 05e88752f4..11d00f335d 100644 --- a/tests/phpunit/languages/LanguageSrTest.php +++ b/tests/phpunit/languages/LanguageSrTest.php @@ -122,7 +122,7 @@ class LanguageSrTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'one', 1 ), array( 'many', 11 ), array( 'one', 91 ), @@ -207,8 +207,8 @@ class LanguageSrTest extends LanguageClassesTestCase { return $this->getLang() ->mConverter ->convertTo( - $text, $variant - ); + $text, $variant + ); } function convertToCyrillic( $text ) { diff --git a/tests/phpunit/languages/LanguageTiTest.php b/tests/phpunit/languages/LanguageTiTest.php index b2cc4c3366..36446c4219 100644 --- a/tests/phpunit/languages/LanguageTiTest.php +++ b/tests/phpunit/languages/LanguageTiTest.php @@ -19,9 +19,9 @@ class LanguageTiTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'one', 0 ), - array( 'one', 1 ), + return array( + array( 'one', 0 ), + array( 'one', 1 ), array( 'other', 2 ), ); } diff --git a/tests/phpunit/languages/LanguageTlTest.php b/tests/phpunit/languages/LanguageTlTest.php index 0299653925..422ad43dc7 100644 --- a/tests/phpunit/languages/LanguageTlTest.php +++ b/tests/phpunit/languages/LanguageTlTest.php @@ -19,9 +19,9 @@ class LanguageTlTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'one', 0 ), - array( 'one', 1 ), + return array( + array( 'one', 0 ), + array( 'one', 1 ), array( 'other', 2 ), ); } diff --git a/tests/phpunit/languages/LanguageUkTest.php b/tests/phpunit/languages/LanguageUkTest.php index 66cd1834b2..3180d30fae 100644 --- a/tests/phpunit/languages/LanguageUkTest.php +++ b/tests/phpunit/languages/LanguageUkTest.php @@ -20,7 +20,7 @@ class LanguageUkTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( + return array( array( 'one', 1 ), array( 'many', 11 ), array( 'one', 91 ), diff --git a/tests/phpunit/languages/LanguageWaTest.php b/tests/phpunit/languages/LanguageWaTest.php index 813222d364..ffa33755e1 100644 --- a/tests/phpunit/languages/LanguageWaTest.php +++ b/tests/phpunit/languages/LanguageWaTest.php @@ -19,9 +19,9 @@ class LanguageWaTest extends LanguageClassesTestCase { } public static function providePlural() { - return array ( - array( 'one', 0 ), - array( 'one', 1 ), + return array( + array( 'one', 0 ), + array( 'one', 1 ), array( 'other', 2 ), ); } diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 2ec0744069..2a1ebc3f79 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -50,8 +50,11 @@ class PHPUnitMaintClass extends Maintenance { // Bug 44192 Do not attempt to send a real e-mail Hooks::clear( 'AlternateUserMailer' ); - Hooks::register( 'AlternateUserMailer', - function() { return false; } + Hooks::register( + 'AlternateUserMailer', + function () { + return false; + } ); } diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index 28d38ab40b..3200e0bd5a 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -16,9 +16,10 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { } protected function setUp() { - global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, - $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, - $wgNamespaceAliases, $wgNamespaceProtection, $parserMemc; + global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgUser, + $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, + $wgEnableParserCache, $wgNamespaceAliases, $wgNamespaceProtection, + $parserMemc; $tmpGlobals = array(); diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index 4b8ee0d148..a6f729b2ea 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -55,8 +55,9 @@ /** * CompletenessTest + * + * Adds toggle checkbox to header */ - // Adds toggle checkbox to header QUnit.config.urlConfig.push( { id: 'completenesstest', label: 'Run CompletenessTest', @@ -95,8 +96,9 @@ /** * Test environment recommended for all QUnit test modules + * + * Whether to log environment changes to the console */ - // Whether to log environment changes to the console QUnit.config.urlConfig.push( 'mwlogenv' ); /**