From 437c84adbc4f8ceb4cc3f8178e5f0ae932304b75 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 24 Apr 2014 11:47:06 +0200 Subject: [PATCH] Pass phpcs-strict on tests/phpunit/GlobalFunctions/ Change-Id: I2acc99ac96d8c738668fae2ecc9a0cee1b695f00 --- .../includes/GlobalFunctions/GlobalTest.php | 107 ++++++++++++++---- .../GlobalFunctions/wfBaseConvertTest.php | 10 +- .../GlobalFunctions/wfBaseNameTest.php | 7 +- .../GlobalFunctions/wfExpandUrlTest.php | 37 +++--- .../GlobalFunctions/wfGetCallerTest.php | 11 +- .../GlobalFunctions/wfTimestampTest.php | 75 ++++++++++-- .../GlobalFunctions/wfUrlencodeTest.php | 6 +- 7 files changed, 201 insertions(+), 52 deletions(-) diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 4e30bdd669..06b512d7ac 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -80,7 +80,11 @@ class GlobalTest extends MediaWikiTestCase { public function testExpandIRI() { $this->assertEquals( "https://te.wikibooks.org/wiki/ఉబుంటు_వాడుకరి_మార్గదర్శని", - wfExpandIRI( "https://te.wikibooks.org/wiki/%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) ); + wfExpandIRI( "https://te.wikibooks.org/wiki/" + . "%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_" + . "%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_" + . "%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0" + . "%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) ); } /** @@ -125,11 +129,20 @@ class GlobalTest extends MediaWikiTestCase { array( array( 'foo' => false ), '' ), // false test array( array( 'foo' => null ), '' ), // null test array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test - array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test + array( + array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), + 'foo=bar&baz=is&asdf=qwerty' + ), // multi-item test array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ), - array( array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ), 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf' ), + array( + array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ), + 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf' + ), array( array( 'foo' => array( 'bar', 'baz' ) ), 'foo%5B0%5D=bar&foo%5B1%5D=baz' ), - array( array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ), 'foo%5Bbar%5D%5Bbar%5D=baz' ), + array( + array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ), + 'foo%5Bbar%5D%5Bbar%5D=baz' + ), ); } @@ -161,9 +174,15 @@ class GlobalTest extends MediaWikiTestCase { array( 'foo=bar&qwerty=asdf', array( 'foo' => 'bar', 'qwerty' => 'asdf' ) ), // multiple value array( 'foo=A%26B%3D5%2B6%40%21%22%27', array( 'foo' => 'A&B=5+6@!"\'' ) ), // urldecoding test array( 'foo%5Bbar%5D=baz', array( 'foo' => array( 'bar' => 'baz' ) ) ), - array( 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf', array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ) ), + array( + 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf', + array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ) + ), array( 'foo%5B0%5D=bar&foo%5B1%5D=baz', array( 'foo' => array( 0 => 'bar', 1 => 'baz' ) ) ), - array( 'foo%5Bbar%5D%5Bbar%5D=baz', array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ) ), + array( + 'foo%5Bbar%5D%5Bbar%5D=baz', + array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ) + ), ); } @@ -288,15 +307,24 @@ class GlobalTest extends MediaWikiTestCase { unlink( $wgDebugLogFile ); wfDebug( "\00305This has böth UTF and control chars\003" ); - $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) ); + $this->assertEquals( + " 05This has böth UTF and control chars ", + file_get_contents( $wgDebugLogFile ) + ); unlink( $wgDebugLogFile ); wfDebugMem(); - $this->assertGreaterThan( 1000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); + $this->assertGreaterThan( + 1000, + preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) + ); unlink( $wgDebugLogFile ); wfDebugMem( true ); - $this->assertGreaterThan( 1000000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); + $this->assertGreaterThan( + 1000000, + preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) + ); unlink( $wgDebugLogFile ); $wgDebugLogFile = $old_log_file; @@ -591,13 +619,48 @@ class GlobalTest extends MediaWikiTestCase { $protocols = array( 'HTTP' => 'http:', 'HTTPS' => 'https:', 'protocol-relative' => '' ); foreach ( $protocols as $pDesc => $p ) { $a = array_merge( $a, array( - array( "$p//www.example.com", array(), false, "No matches for empty domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'www.example.com' ), true, "Exact match in domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'example.com' ), true, "Match without subdomain in domains array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'www.example.com', 'www.example2.com', 'www.example3.com' ), true, "Exact match with other domains in array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'example.com', 'example2.com', 'example3,com' ), true, "Match without subdomain with other domains in array, $pDesc URL" ), - array( "$p//www.example4.com", array( 'example.com', 'example2.com', 'example3,com' ), false, "Domain not in array, $pDesc URL" ), - array( "$p//nds-nl.wikipedia.org", array( 'nl.wikipedia.org' ), false, "Non-matching substring of domain, $pDesc URL" ), + array( + "$p//www.example.com", + array(), + false, + "No matches for empty domains array, $pDesc URL" + ), + array( + "$p//www.example.com", + array( 'www.example.com' ), + true, + "Exact match in domains array, $pDesc URL" + ), + array( + "$p//www.example.com", + array( 'example.com' ), + true, + "Match without subdomain in domains array, $pDesc URL" + ), + array( + "$p//www.example2.com", + array( 'www.example.com', 'www.example2.com', 'www.example3.com' ), + true, + "Exact match with other domains in array, $pDesc URL" + ), + array( + "$p//www.example2.com", + array( 'example.com', 'example2.com', 'example3,com' ), + true, + "Match without subdomain with other domains in array, $pDesc URL" + ), + array( + "$p//www.example4.com", + array( 'example.com', 'example2.com', 'example3,com' ), + false, + "Domain not in array, $pDesc URL" + ), + array( + "$p//nds-nl.wikipedia.org", + array( 'nl.wikipedia.org' ), + false, + "Non-matching substring of domain, $pDesc URL" + ), ) ); } @@ -620,7 +683,9 @@ class GlobalTest extends MediaWikiTestCase { * @dataProvider provideWfShellMaintenanceCmdList * @covers ::wfShellMaintenanceCmd */ - public function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) { + public function testWfShellMaintenanceCmd( $script, $parameters, $options, + $expected, $description + ) { if ( wfIsWindows() ) { // Approximation that's good enough for our purposes just now $expected = str_replace( "'", '"', $expected ); @@ -642,9 +707,13 @@ class GlobalTest extends MediaWikiTestCase { array( 'eval.php', array( '--help', '--test', 'X' ), array( 'wrapper' => 'MWScript.php' ), "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'", "Called eval.php --help --test with wrapper option" ), - array( 'eval.php', array( '--help', '--test', 'y' ), array( 'php' => 'php5', 'wrapper' => 'MWScript.php' ), + array( + 'eval.php', + array( '--help', '--test', 'y' ), + array( 'php' => 'php5', 'wrapper' => 'MWScript.php' ), "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'", - "Called eval.php --help --test with wrapper and php option" ), + "Called eval.php --help --test with wrapper and php option" + ), ); } /* @TODO many more! */ diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php index 7da804e69e..79dd91d403 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php @@ -176,7 +176,13 @@ class WfBaseConvertTest extends MediaWikiTestCase { public function testPadding() { $number = "10101010101"; - $this->assertSame( strlen( $number ) + 5, strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) + 5 ) ) ); - $this->assertSame( strlen( $number ), strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) - 5 ) ) ); + $this->assertSame( + strlen( $number ) + 5, + strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) + 5 ) ) + ); + $this->assertSame( + strlen( $number ), + strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) - 5 ) ) + ); } } diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php index 8c5480403e..516c1b93d6 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php @@ -27,8 +27,11 @@ class WfBaseNameTest extends MediaWikiTestCase { array( '/aaaa/', 'aaaa' ), array( '\\aaaa\\', 'aaaa' ), array( '\\aaaa\\', 'aaaa' ), - array( '/mnt/upload3/wikipedia/en/thumb/8/8b/Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg', - '93px-Zork_Grand_Inquisitor_box_cover.jpg' ), + array( + '/mnt/upload3/wikipedia/en/thumb/8/8b/' + . 'Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg', + '93px-Zork_Grand_Inquisitor_box_cover.jpg' + ), array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ), array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ), ); diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php index b06f3d29a5..9effc30218 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php @@ -6,7 +6,9 @@ class WfExpandUrlTest extends MediaWikiTestCase { /** * @dataProvider provideExpandableUrls */ - public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto, $server, $canServer, $httpsMode, $message ) { + public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto, + $server, $canServer, $httpsMode, $message + ) { // Fake $wgServer, $wgCanonicalServer and $wgRequest->getProtocol() $this->setMwGlobals( array( 'wgServer' => $server, @@ -47,21 +49,24 @@ class WfExpandUrlTest extends MediaWikiTestCase { $retval[] = array( 'http://example.com', 'http://example.com', $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified http URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" + "Testing fully qualified http URLs (no need to expand) " + . "(defaultProto: $protoDesc , wgServer: $server, " + . "wgCanonicalServer: $canServer, current request protocol: $mode )" ); $retval[] = array( 'https://example.com', 'https://example.com', $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified https URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" + "Testing fully qualified https URLs (no need to expand) " + . "(defaultProto: $protoDesc , wgServer: $server, " + . "wgCanonicalServer: $canServer, current request protocol: $mode )" ); # Would be nice to support this, see fixme on wfExpandUrl() $retval[] = array( "wiki/FooBar", 'wiki/FooBar', $defaultProto, $server, $canServer, $httpsMode, - "Test non-expandable relative URLs ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" + "Test non-expandable relative URLs (defaultProto: $protoDesc, " + . "wgServer: $server, wgCanonicalServer: $canServer, " + . "current request protocol: $mode )" ); // Determine expected protocol @@ -86,14 +91,20 @@ class WfExpandUrlTest extends MediaWikiTestCase { $retval[] = array( "$p//wikipedia.org", '//wikipedia.org', $defaultProto, $server, $canServer, $httpsMode, - "Test protocol-relative URL ' . - '(defaultProto: $protoDesc, wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" + "Test protocol-relative URL (defaultProto: $protoDesc, " + . "wgServer: $server, wgCanonicalServer: $canServer, " + . "current request protocol: $mode )" ); $retval[] = array( - "$srv/wiki/FooBar", '/wiki/FooBar', - $defaultProto, $server, $canServer, $httpsMode, - "Testing expanding URL beginning with / ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" + "$srv/wiki/FooBar", + '/wiki/FooBar', + $defaultProto, + $server, + $canServer, + $httpsMode, + "Testing expanding URL beginning with / (defaultProto: $protoDesc, " + . "wgServer: $server, wgCanonicalServer: $canServer, " + . "current request protocol: $mode )" ); } } diff --git a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php index 6229624586..bdb3044a62 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php @@ -4,7 +4,6 @@ * @covers ::wfGetCaller */ class WfGetCallerTest extends MediaWikiTestCase { - public function testZero() { $this->assertEquals( __METHOD__, wfGetCaller( 1 ) ); } @@ -31,10 +30,16 @@ class WfGetCallerTest extends MediaWikiTestCase { public function testN() { $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) ); - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) ); + $this->assertEquals( + 'WfGetCallerTest::intermediateFunction', + self::intermediateFunction( 1, 0 ) + ); for ( $i = 0; $i < 10; $i++ ) { - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( $i + 1, $i ) ); + $this->assertEquals( + 'WfGetCallerTest::intermediateFunction', + self::intermediateFunction( $i + 1, $i ) + ); } } } diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php index 5998f1861b..6335d11ef0 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php @@ -32,22 +32,52 @@ class WfTimestampTest extends MediaWikiTestCase { array( '2001-01-15 12:34:56', TS_MW, '20010115123456', 'TS_DB to TS_MW' ), array( '2001-01-15 12:34:56', TS_UNIX, 979562096, 'TS_DB to TS_UNIX' ), array( '2001-01-15 12:34:56', TS_DB, '2001-01-15 12:34:56', 'TS_DB to TS_DB' ), - array( '2001-01-15 12:34:56', TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_DB to TS_ISO_8601_BASIC' ), + array( + '2001-01-15 12:34:56', + TS_ISO_8601_BASIC, + '20010115T123456Z', + 'TS_DB to TS_ISO_8601_BASIC' + ), # rfc2822 section 3.3 array( '20010115123456', TS_RFC2822, 'Mon, 15 Jan 2001 12:34:56 GMT', 'TS_MW to TS_RFC2822' ), array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), - array( ' Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 with leading space to TS_MW' ), - array( '15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 without optional day-of-week to TS_MW' ), + array( + ' Mon, 15 Jan 2001 12:34:56 GMT', + TS_MW, + '20010115123456', + 'TS_RFC2822 with leading space to TS_MW' + ), + array( + '15 Jan 2001 12:34:56 GMT', + TS_MW, + '20010115123456', + 'TS_RFC2822 without optional day-of-week to TS_MW' + ), # FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; Folding white space # obs-FWS = 1*WSP *(CRLF 1*WSP) ; Section 4.2 array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), # WSP = SP / HTAB ; rfc2234 - array( "Mon, 15 Jan\x092001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB to TS_MW' ), - array( "Mon, 15 Jan\x09 \x09 2001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB and SP to TS_MW' ), - array( 'Sun, 6 Nov 94 08:49:37 GMT', TS_MW, '19941106084937', 'TS_RFC2822 with obsolete year to TS_MW' ), + array( + "Mon, 15 Jan\x092001 12:34:56 GMT", + TS_MW, + '20010115123456', + 'TS_RFC2822 with HTAB to TS_MW' + ), + array( + "Mon, 15 Jan\x09 \x09 2001 12:34:56 GMT", + TS_MW, + '20010115123456', + 'TS_RFC2822 with HTAB and SP to TS_MW' + ), + array( + 'Sun, 6 Nov 94 08:49:37 GMT', + TS_MW, + '19941106084937', + 'TS_RFC2822 with obsolete year to TS_MW' + ), ); } @@ -63,19 +93,33 @@ class WfTimestampTest extends MediaWikiTestCase { public static function provideOldTimestamps() { return array( - array( '19011213204554', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:54 GMT', 'Earliest time according to php documentation' ), + array( + '19011213204554', + TS_RFC2822, + 'Fri, 13 Dec 1901 20:45:54 GMT', + 'Earliest time according to PHP documentation' + ), array( '20380119031407', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:07 GMT', 'Latest 32 bit time' ), array( '19011213204552', TS_UNIX, '-2147483648', 'Earliest 32 bit unix time' ), array( '20380119031407', TS_UNIX, '2147483647', 'Latest 32 bit unix time' ), array( '19011213204552', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:52 GMT', 'Earliest 32 bit time' ), - array( '19011213204551', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:51 GMT', 'Earliest 32 bit time - 1' ), + array( + '19011213204551', + TS_RFC2822, + 'Fri, 13 Dec 1901 20:45:51 GMT', 'Earliest 32 bit time - 1' + ), array( '20380119031408', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:08 GMT', 'Latest 32 bit time + 1' ), array( '19011212000000', TS_MW, '19011212000000', 'Convert to itself r74778#c10645' ), array( '19011213204551', TS_UNIX, '-2147483649', 'Earliest 32 bit unix time - 1' ), array( '20380119031408', TS_UNIX, '2147483648', 'Latest 32 bit unix time + 1' ), array( '-2147483649', TS_MW, '19011213204551', '1901 negative unix time to MediaWiki' ), array( '-5331871504', TS_MW, '18010115123456', '1801 negative unix time to MediaWiki' ), - array( '0117-08-09 12:34:56', TS_RFC2822, 'Tue, 09 Aug 0117 12:34:56 GMT', 'Death of Roman Emperor [[Trajan]]' ), + array( + '0117-08-09 12:34:56', + TS_RFC2822, + 'Tue, 09 Aug 0117 12:34:56 GMT', + 'Death of Roman Emperor [[Trajan]]' + ), /* @todo FIXME: 00 to 101 years are taken as being in [1970-2069] */ array( '-58979923200', TS_RFC2822, 'Sun, 01 Jan 0101 00:00:00 GMT', '1/1/101' ), @@ -85,7 +129,12 @@ class WfTimestampTest extends MediaWikiTestCase { * We are completely off RFC2822 requirement of year being * 1900 or later. */ - array( '-62142076800', TS_RFC2822, 'Wed, 18 Oct 0000 00:00:00 GMT', 'ISO 8601:2004 [[year 0]], also called [[1 BC]]' ), + array( + '-62142076800', + TS_RFC2822, + 'Wed, 18 Oct 0000 00:00:00 GMT', + 'ISO 8601:2004 [[year 0]], also called [[1 BC]]' + ), ); } @@ -106,7 +155,11 @@ class WfTimestampTest extends MediaWikiTestCase { array( 'Sunday, 06-Nov-94 08:49:37 GMT', '19941106084937', 'RFC 850 date' ), array( 'Sun Nov 6 08:49:37 1994', '19941106084937', "ANSI C's asctime() format" ), // See http://www.squid-cache.org/mail-archive/squid-users/200307/0122.html and r77171 - array( 'Mon, 22 Nov 2010 14:12:42 GMT; length=52626', '20101122141242', 'Netscape extension to HTTP/1.0' ), + array( + 'Mon, 22 Nov 2010 14:12:42 GMT; length=52626', + '20101122141242', + 'Netscape extension to HTTP/1.0' + ), ); } diff --git a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php index ce6c82c505..783b985ddb 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php @@ -62,12 +62,14 @@ class WfUrlencodeTest extends MediaWikiTestCase { return $expectations; } elseif ( is_array( $expectations ) ) { if ( !array_key_exists( $server, $expectations ) ) { - throw new MWException( __METHOD__ . " expectation does not have any value for server name $server. Check the provider array.\n" ); + throw new MWException( __METHOD__ . " expectation does not have any " + . "value for server name $server. Check the provider array.\n" ); } else { return $expectations[$server]; } } else { - throw new MWException( __METHOD__ . " given invalid expectation for '$server'. Should be a string or an array( => ).\n" ); + throw new MWException( __METHOD__ . " given invalid expectation for " + . "'$server'. Should be a string or an array( => ).\n" ); } } -- 2.20.1