jenkins-bot has submitted this change and it was merged.
Change subject: Pass phpcs-strict on some test files (7/11)
......................................................................
Pass phpcs-strict on some test files (7/11)
Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
---
M tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
M tests/phpunit/includes/filebackend/FileBackendTest.php
M tests/phpunit/includes/filerepo/StoreBatchTest.php
M tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php
M tests/phpunit/includes/installer/InstallDocFormatterTest.php
M tests/phpunit/includes/installer/OracleInstallerTest.php
M tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
M tests/phpunit/includes/libs/CSSMinTest.php
M tests/phpunit/includes/libs/GenericArrayObjectTest.php
M tests/phpunit/includes/libs/JavaScriptMinifierTest.php
10 files changed, 222 insertions(+), 53 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
index 351908b..e914c72 100644
--- a/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
+++ b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
@@ -93,13 +93,32 @@
);
$otherTestCases[] = array(
$this->getMockDiff( array( $this->getMockDiffOp(
'change', array( 'd1' ), array( 'a1' ) ) ) ),
- array( array( 'action' => 'change', 'old' => 'd1',
'new' => 'mockLine', 'newline' => 1, 'oldline' => 1 ) ),
+ array( array(
+ 'action' => 'change',
+ 'old' => 'd1',
+ 'new' => 'mockLine',
+ 'newline' => 1, 'oldline' => 1
+ ) ),
);
$otherTestCases[] = array(
- $this->getMockDiff( array( $this->getMockDiffOp(
'change', array( 'd1', 'd2' ), array( 'a1', 'a2' ) ) ) ),
+ $this->getMockDiff( array( $this->getMockDiffOp(
+ 'change',
+ array( 'd1', 'd2' ),
+ array( 'a1', 'a2' )
+ ) ) ),
array(
- array( 'action' => 'change', 'old' => 'd1',
'new' => 'mockLine', 'newline' => 1, 'oldline' => 1 ),
- array( 'action' => 'change', 'old' => 'd2',
'new' => 'mockLine', 'newline' => 2, 'oldline' => 2 ),
+ array(
+ 'action' => 'change',
+ 'old' => 'd1',
+ 'new' => 'mockLine',
+ 'newline' => 1, 'oldline' => 1
+ ),
+ array(
+ 'action' => 'change',
+ 'old' => 'd2',
+ 'new' => 'mockLine',
+ 'newline' => 2, 'oldline' => 2
+ ),
),
);
diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php
b/tests/phpunit/includes/filebackend/FileBackendTest.php
index 1220270..a7bfbfe 100644
--- a/tests/phpunit/includes/filebackend/FileBackendTest.php
+++ b/tests/phpunit/includes/filebackend/FileBackendTest.php
@@ -156,7 +156,10 @@
array( 'mwstore://backend/container/path',
'mwstore://backend/container/path' ),
array( 'mwstore://backend/container//path',
'mwstore://backend/container/path' ),
array( 'mwstore://backend/container///path',
'mwstore://backend/container/path' ),
- array( 'mwstore://backend/container///path//to///obj',
'mwstore://backend/container/path/to/obj' ),
+ array(
+ 'mwstore://backend/container///path//to///obj',
+ 'mwstore://backend/container/path/to/obj'
+ ),
array( 'mwstore://', null ),
array( 'mwstore://backend', null ),
array( 'mwstore://backend//container/path', null ),
@@ -1234,11 +1237,23 @@
$contents = $this->backend->getFileContentsMulti(
array( 'srcs' => $source ) );
foreach ( $contents as $path => $data ) {
$this->assertNotEquals( false, $data, "Contents
of $path exists ($backendName)." );
- $this->assertEquals( current( $content ),
$data, "Contents of $path is correct ($backendName)." );
+ $this->assertEquals(
+ current( $content ),
+ $data,
+ "Contents of $path is correct
($backendName)."
+ );
next( $content );
}
- $this->assertEquals( $source, array_keys( $contents ),
"Contents in right order ($backendName)." );
- $this->assertEquals( count( $source ), count( $contents
), "Contents array size correct ($backendName)." );
+ $this->assertEquals(
+ $source,
+ array_keys( $contents ),
+ "Contents in right order ($backendName)."
+ );
+ $this->assertEquals(
+ count( $source ),
+ count( $contents ),
+ "Contents array size correct ($backendName)."
+ );
} else {
$data = $this->backend->getFileContents( array( 'src'
=> $source ) );
$this->assertNotEquals( false, $data, "Contents of
$source exists ($backendName)." );
@@ -1297,18 +1312,34 @@
"Creation of local copy of $path
succeeded ($backendName)." );
$contents = file_get_contents(
$tmpFile->getPath() );
$this->assertNotEquals( false, $contents,
"Local copy of $path exists ($backendName)." );
- $this->assertEquals( current( $content ),
$contents, "Local copy of $path is correct ($backendName)." );
+ $this->assertEquals(
+ current( $content ),
+ $contents,
+ "Local copy of $path is correct
($backendName)."
+ );
next( $content );
}
- $this->assertEquals( $source, array_keys( $tmpFiles ),
"Local copies in right order ($backendName)." );
- $this->assertEquals( count( $source ), count( $tmpFiles
), "Local copies array size correct ($backendName)." );
+ $this->assertEquals(
+ $source,
+ array_keys( $tmpFiles ),
+ "Local copies in right order ($backendName)."
+ );
+ $this->assertEquals(
+ count( $source ),
+ count( $tmpFiles ),
+ "Local copies array size correct
($backendName)."
+ );
} else {
$tmpFile = $this->backend->getLocalCopy( array( 'src'
=> $source ) );
$this->assertNotNull( $tmpFile,
"Creation of local copy of $source succeeded
($backendName)." );
$contents = file_get_contents( $tmpFile->getPath() );
$this->assertNotEquals( false, $contents, "Local copy
of $source exists ($backendName)." );
- $this->assertEquals( $content[0], $contents, "Local
copy of $source is correct ($backendName)." );
+ $this->assertEquals(
+ $content[0],
+ $contents,
+ "Local copy of $source is correct
($backendName)."
+ );
}
$obj = new stdClass();
@@ -1367,11 +1398,23 @@
"Creation of local copy of $path
succeeded ($backendName)." );
$contents = file_get_contents(
$tmpFile->getPath() );
$this->assertNotEquals( false, $contents,
"Local ref of $path exists ($backendName)." );
- $this->assertEquals( current( $content ),
$contents, "Local ref of $path is correct ($backendName)." );
+ $this->assertEquals(
+ current( $content ),
+ $contents,
+ "Local ref of $path is correct
($backendName)."
+ );
next( $content );
}
- $this->assertEquals( $source, array_keys( $tmpFiles ),
"Local refs in right order ($backendName)." );
- $this->assertEquals( count( $source ), count( $tmpFiles
), "Local refs array size correct ($backendName)." );
+ $this->assertEquals(
+ $source,
+ array_keys( $tmpFiles ),
+ "Local refs in right order ($backendName)."
+ );
+ $this->assertEquals(
+ count( $source ),
+ count( $tmpFiles ),
+ "Local refs array size correct ($backendName)."
+ );
} else {
$tmpFile = $this->backend->getLocalReference( array(
'src' => $source ) );
$this->assertNotNull( $tmpFile,
@@ -1950,7 +1993,10 @@
$this->assertEquals( $expected, $list, "Correct file listing
($backendName)." );
// Actual listing (no trailing slash) at root with advise
- $iter = $this->backend->getFileList( array( 'dir' =>
"$base/unittest-cont1", 'adviseStat' => 1 ) );
+ $iter = $this->backend->getFileList( array(
+ 'dir' => "$base/unittest-cont1",
+ 'adviseStat' => 1
+ ) );
$list = $this->listToArray( $iter );
sort( $list );
$this->assertEquals( $expected, $list, "Correct file listing
($backendName)." );
@@ -1983,7 +2029,10 @@
$this->assertEquals( $expected, $list, "Correct file listing
($backendName)." );
// Actual listing (no trailing slash) at subdir with advise
- $iter = $this->backend->getFileList( array( 'dir' =>
"$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) );
+ $iter = $this->backend->getFileList( array(
+ 'dir' => "$base/unittest-cont1/e/subdir2/subdir",
+ 'adviseStat' => 1
+ ) );
$list = $this->listToArray( $iter );
sort( $list );
$this->assertEquals( $expected, $list, "Correct file listing
($backendName)." );
@@ -2019,13 +2068,18 @@
sort( $expected );
// Actual listing (top files only) at subdir
- $iter = $this->backend->getTopFileList( array( 'dir' =>
"$base/unittest-cont1/e/subdir2/subdir" ) );
+ $iter = $this->backend->getTopFileList(
+ array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir"
)
+ );
$list = $this->listToArray( $iter );
sort( $list );
$this->assertEquals( $expected, $list, "Correct top file
listing ($backendName)." );
// Actual listing (top files only) at subdir with advise
- $iter = $this->backend->getTopFileList( array( 'dir' =>
"$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) );
+ $iter = $this->backend->getTopFileList( array(
+ 'dir' => "$base/unittest-cont1/e/subdir2/subdir",
+ 'adviseStat' => 1
+ ) );
$list = $this->listToArray( $iter );
sort( $list );
$this->assertEquals( $expected, $list, "Correct top file
listing ($backendName)." );
@@ -2162,7 +2216,10 @@
// Actual listing (with trailing slash)
$list = array();
- $iter = $this->backend->getTopDirectoryList( array( 'dir' =>
"$base/unittest-cont1/e/subdir2/" ) );
+ $iter = $this->backend->getTopDirectoryList(
+ array( 'dir' => "$base/unittest-cont1/e/subdir2/" )
+ );
+
foreach ( $iter as $file ) {
$list[] = $file;
}
@@ -2177,7 +2234,11 @@
}
sort( $list );
- $this->assertEquals( $expected, $list, "Correct top dir listing
($backendName), second iteration." );
+ $this->assertEquals(
+ $expected,
+ $list,
+ "Correct top dir listing ($backendName), second
iteration."
+ );
// Expected listing (recursive)
$expected = array(
diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php
b/tests/phpunit/includes/filerepo/StoreBatchTest.php
index 787d83c..3276cf9 100644
--- a/tests/phpunit/includes/filerepo/StoreBatchTest.php
+++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php
@@ -130,7 +130,17 @@
*/
public function teststore() {
global $IP;
- $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png",
"$IP/skins/monobook/video.png", false );
- $this->storecohort( "Test2.png", "$IP/skins/monobook/wiki.png",
"$IP/skins/monobook/video.png", true );
+ $this->storecohort(
+ "Test1.png",
+ "$IP/skins/monobook/wiki.png",
+ "$IP/skins/monobook/video.png",
+ false
+ );
+ $this->storecohort(
+ "Test2.png",
+ "$IP/skins/monobook/wiki.png",
+ "$IP/skins/monobook/video.png",
+ true
+ );
}
}
diff --git a/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php
b/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php
index c41acef..6384e3a 100644
--- a/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php
+++ b/tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php
@@ -30,8 +30,9 @@
public function testValidateCallsUserDefinedValidationCallback() {
$called = false;
$field = new HTMLCheckMatrix( self::$defaultOptions + array(
- 'validation-callback' => function() use (
&$called ) {
+ 'validation-callback' => function () use (
&$called ) {
$called = true;
+
return false;
},
) );
diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php
b/tests/phpunit/includes/installer/InstallDocFormatterTest.php
index 8466684..064d518 100644
--- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php
+++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php
@@ -48,17 +48,24 @@
# Transform '$wgFooBar' links
array(
- '<span
class="config-plainlink">[https://www.mediawiki.org/wiki/Manual:$wgFooBar
$wgFooBar]</span>',
+ '<span class="config-plainlink">'
+ .
'[https://www.mediawiki.org/wiki/Manual:$wgFooBar $wgFooBar]</span>',
'$wgFooBar', 'Testing basic $wgFooBar' ),
array(
- '<span
class="config-plainlink">[https://www.mediawiki.org/wiki/Manual:$wgFooBar45
$wgFooBar45]</span>',
+ '<span class="config-plainlink">'
+ .
'[https://www.mediawiki.org/wiki/Manual:$wgFooBar45 $wgFooBar45]</span>',
'$wgFooBar45', 'Testing $wgFooBar45 (with
numbers)' ),
array(
- '<span
class="config-plainlink">[https://www.mediawiki.org/wiki/Manual:$wgFoo_Bar
$wgFoo_Bar]</span>',
+ '<span class="config-plainlink">'
+ .
'[https://www.mediawiki.org/wiki/Manual:$wgFoo_Bar $wgFoo_Bar]</span>',
'$wgFoo_Bar', 'Testing $wgFoo_Bar (with
underscore)' ),
# Icky variables that shouldn't link
- array( '$myAwesomeVariable', '$myAwesomeVariable',
'Testing $myAwesomeVariable (not starting with $wg)' ),
+ array(
+ '$myAwesomeVariable',
+ '$myAwesomeVariable',
+ 'Testing $myAwesomeVariable (not starting with
$wg)'
+ ),
array( '$()not!a&Var', '$()not!a&Var', 'Testing
$()not!a&Var (obviously not a variable)' ),
);
}
diff --git a/tests/phpunit/includes/installer/OracleInstallerTest.php
b/tests/phpunit/includes/installer/OracleInstallerTest.php
index 66e6559..fdcecf9 100644
--- a/tests/phpunit/includes/installer/OracleInstallerTest.php
+++ b/tests/phpunit/includes/installer/OracleInstallerTest.php
@@ -40,7 +40,11 @@
array( true, 'host:1521/service:shared', 'Host, port,
service and shared server type' ),
array( true, 'host:1521/service:dedicated', 'Host,
port, service and dedicated server type' ),
array( true, 'host:1521/service:pooled', 'Host, port,
service and pooled server type' ),
- array( true, 'host:1521/service:shared/instance1',
'Host, port, service, server type and instance' ),
+ array(
+ true,
+ 'host:1521/service:shared/instance1',
+ 'Host, port, service, server type and instance'
+ ),
array( true, 'host:1521//instance1', 'Host, port and
instance' ),
);
}
diff --git a/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
b/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
index 3d2b5d8..3e232a9 100644
--- a/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
+++ b/tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php
@@ -28,7 +28,11 @@
}
$title->getBacklinkCache()->clear();
- $this->assertEquals( 20,
$title->getBacklinkCache()->getNumLinks( 'pagelinks' ), 'Correct number of
backlinks' );
+ $this->assertEquals(
+ 20,
+ $title->getBacklinkCache()->getNumLinks( 'pagelinks' ),
+ 'Correct number of backlinks'
+ );
$job = new RefreshLinksJob( $title, array( 'recursive' => true,
'table' => 'pagelinks' )
+ Job::newRootJobParams(
"refreshlinks:pagelinks:{$title->getPrefixedText()}" ) );
@@ -55,7 +59,12 @@
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs[9]->params['rootJobSignature'],
'Recursive sub-job has root params' );
- $jobs2 = BacklinkJobUtils::partitionBacklinkJob( $jobs[9], 9,
1, array( 'params' => $extraParams ) );
+ $jobs2 = BacklinkJobUtils::partitionBacklinkJob(
+ $jobs[9],
+ 9,
+ 1,
+ array( 'params' => $extraParams )
+ );
$this->assertEquals( 10, count( $jobs2 ), 'Correct number of
sub-jobs' );
$this->assertEquals( $pages[9], current(
$jobs2[0]->params['pages'] ),
@@ -73,7 +82,12 @@
$this->assertEquals( $extraParams['rootJobSignature'],
$jobs2[9]->params['rootJobSignature'],
'Recursive sub-job has root params' );
- $jobs3 = BacklinkJobUtils::partitionBacklinkJob( $jobs2[9], 9,
1, array( 'params' => $extraParams ) );
+ $jobs3 = BacklinkJobUtils::partitionBacklinkJob(
+ $jobs2[9],
+ 9,
+ 1,
+ array( 'params' => $extraParams )
+ );
$this->assertEquals( 2, count( $jobs3 ), 'Correct number of
sub-jobs' );
$this->assertEquals( $pages[18], current(
$jobs3[0]->params['pages'] ),
diff --git a/tests/phpunit/includes/libs/CSSMinTest.php
b/tests/phpunit/includes/libs/CSSMinTest.php
index 5c0487b..5475a82 100644
--- a/tests/phpunit/includes/libs/CSSMinTest.php
+++ b/tests/phpunit/includes/libs/CSSMinTest.php
@@ -25,7 +25,11 @@
public function testMinify( $code, $expectedOutput ) {
$minified = CSSMin::minify( $code );
- $this->assertEquals( $expectedOutput, $minified, 'Minified
output should be in the form expected.' );
+ $this->assertEquals(
+ $expectedOutput,
+ $minified,
+ 'Minified output should be in the form expected.'
+ );
}
public static function provideMinifyCases() {
@@ -69,7 +73,8 @@
}
/**
- * This tests funky parameters to CSSMin::remap. testRemapRemapping
tests the basic functionality.
+ * This tests funky parameters to CSSMin::remap. testRemapRemapping
tests
+ * the basic functionality.
*
* @dataProvider provideRemapCases
* @covers CSSMin::remap
@@ -78,7 +83,11 @@
$remapped = call_user_func_array( 'CSSMin::remap', $params );
$messageAdd = " Case: $message";
- $this->assertEquals( $expectedOutput, $remapped, 'CSSMin::remap
should return the expected url form.' . $messageAdd );
+ $this->assertEquals(
+ $expectedOutput,
+ $remapped,
+ 'CSSMin::remap should return the expected url form.' .
$messageAdd
+ );
}
public static function provideRemapCases() {
@@ -201,7 +210,8 @@
array(
'Embedded file (inline @embed)',
'foo { background: /* @embed */ url(red.gif);
}',
- "foo { background: url($red); background:
url(http://localhost/w/red.gif?timestamp)!ie; }",
+ "foo { background: url($red); "
+ . "background:
url(http://localhost/w/red.gif?timestamp)!ie; }",
),
array(
'Can not embed large files',
@@ -211,27 +221,35 @@
array(
'Two regular files in one rule',
'foo { background: url(red.gif),
url(green.gif); }',
- 'foo { background:
url(http://localhost/w/red.gif?timestamp),
url(http://localhost/w/green.gif?timestamp); }',
+ 'foo { background:
url(http://localhost/w/red.gif?timestamp), '
+ .
'url(http://localhost/w/green.gif?timestamp); }',
),
array(
'Two embedded files in one rule',
'foo { /* @embed */ background: url(red.gif),
url(green.gif); }',
- "foo { background: url($red), url($green);
background: url(http://localhost/w/red.gif?timestamp),
url(http://localhost/w/green.gif?timestamp)!ie; }",
+ "foo { background: url($red), url($green); "
+ . "background:
url(http://localhost/w/red.gif?timestamp), "
+ .
"url(http://localhost/w/green.gif?timestamp)!ie; }",
),
array(
'Two embedded files in one rule (inline
@embed)',
'foo { background: /* @embed */ url(red.gif),
/* @embed */ url(green.gif); }',
- "foo { background: url($red), url($green);
background: url(http://localhost/w/red.gif?timestamp),
url(http://localhost/w/green.gif?timestamp)!ie; }",
+ "foo { background: url($red), url($green); "
+ . "background:
url(http://localhost/w/red.gif?timestamp), "
+ .
"url(http://localhost/w/green.gif?timestamp)!ie; }",
),
array(
'Two embedded files in one rule (inline
@embed), one too large',
'foo { background: /* @embed */ url(red.gif),
/* @embed */ url(large.png); }',
- "foo { background: url($red),
url(http://localhost/w/large.png?timestamp); background:
url(http://localhost/w/red.gif?timestamp),
url(http://localhost/w/large.png?timestamp)!ie; }",
+ "foo { background: url($red),
url(http://localhost/w/large.png?timestamp); "
+ . "background:
url(http://localhost/w/red.gif?timestamp), "
+ .
"url(http://localhost/w/large.png?timestamp)!ie; }",
),
array(
'Practical example with some noise',
'foo { /* @embed */ background: #f9f9f9
url(red.gif) 0 0 no-repeat; }',
- "foo { background: #f9f9f9 url($red) 0 0
no-repeat; background: #f9f9f9 url(http://localhost/w/red.gif?timestamp) 0 0
no-repeat!ie; }",
+ "foo { background: #f9f9f9 url($red) 0 0
no-repeat; "
+ . "background: #f9f9f9
url(http://localhost/w/red.gif?timestamp) 0 0 no-repeat!ie; }",
),
array(
'Does not mess with other properties',
@@ -324,7 +342,10 @@
// - Using a tab in a string value (turns into a space)
array( "foo { content: '\t'; }", "foo{content:'\t'}" ),
// - Using css-like syntax in string values
- array( 'foo::after { content: "{;}"; position:
absolute; }', 'foo::after{content:"{;}";position:absolute}' ),
+ array(
+ 'foo::after { content: "{;}"; position:
absolute; }',
+ 'foo::after{content:"{;}";position:absolute}'
+ ),
);
}
}
diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php
b/tests/phpunit/includes/libs/GenericArrayObjectTest.php
index 806f5bf..4911f73 100644
--- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php
+++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php
@@ -30,7 +30,8 @@
abstract class GenericArrayObjectTest extends MediaWikiTestCase {
/**
- * Returns objects that can serve as elements in the concrete
GenericArrayObject deriving class being tested.
+ * Returns objects that can serve as elements in the concrete
+ * GenericArrayObject deriving class being tested.
*
* @since 1.20
*
diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
index 01c330a..c8795b2 100644
--- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
+++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
@@ -14,16 +14,28 @@
* At some point there was a bug that caused this
comment to be ended at '* /',
* causing /M... to be left as the beginning of a regex.
*/
- array( "/**\n * Foo\n * {\n * 'bar' : {\n * //Multiple
rules with configurable operators\n * 'baz' : false\n * }\n */", "" ),
+ array(
+ "/**\n * Foo\n * {\n * 'bar' : {\n * "
+ . "//Multiple rules with configurable
operators\n * 'baz' : false\n * }\n */",
+ "" ),
/**
* ' Foo \' bar \
* baz \' quox ' .
*/
- array( "' Foo \\' bar \\\n baz \\' quox '
.length", "' Foo \\' bar \\\n baz \\' quox '.length" ),
- array( "\" Foo \\\" bar \\\n baz \\\" quox \"
.length", "\" Foo \\\" bar \\\n baz \\\" quox \".length" ),
+ array(
+ "' Foo \\' bar \\\n baz \\' quox '
.length",
+ "' Foo \\' bar \\\n baz \\' quox
'.length"
+ ),
+ array(
+ "\" Foo \\\" bar \\\n baz \\\" quox \"
.length",
+ "\" Foo \\\" bar \\\n baz \\\" quox
\".length"
+ ),
array( "// Foo b/ar baz", "" ),
- array( "/ Foo \\/ bar [ / \\] / ] baz /
.length", "/ Foo \\/ bar [ / \\] / ] baz /.length" ),
+ array(
+ "/ Foo \\/ bar [ / \\] / ] baz /
.length",
+ "/ Foo \\/ bar [ / \\] / ] baz
/.length"
+ ),
// HTML comments
array( "<!-- Foo bar", "" ),
@@ -49,7 +61,10 @@
// Semicolon insertion between an expression having an
inline
// comment after it, and a statement on the next line
(bug 27046).
- array( "var a = this //foo bar \n for ( b = 0; c < d;
b++ ) {}", "var a=this\nfor(b=0;c<d;b++){}" ),
+ array(
+ "var a = this //foo bar \n for ( b = 0; c < d;
b++ ) {}",
+ "var a=this\nfor(b=0;c<d;b++){}"
+ ),
// Token separation
array( "x in y", "x in y" ),
@@ -85,16 +100,28 @@
array( "var foo=\"\\\nblah\\\n\";", "var
foo=\"\\\nblah\\\n\";" ),
// Multiline quoted string followed by string with
spaces
- array( "var foo=\"\\\nblah\\\n\";\nvar baz = \" foo
\";\n", "var foo=\"\\\nblah\\\n\";var baz=\" foo \";" ),
+ array(
+ "var foo=\"\\\nblah\\\n\";\nvar baz = \" foo
\";\n",
+ "var foo=\"\\\nblah\\\n\";var baz=\" foo \";"
+ ),
// URL in quoted string ( // is not a comment)
- array(
"aNode.setAttribute('href','http://foo.bar.org/baz');",
"aNode.setAttribute('href','http://foo.bar.org/baz');" ),
+ array(
+
"aNode.setAttribute('href','http://foo.bar.org/baz');",
+
"aNode.setAttribute('href','http://foo.bar.org/baz');"
+ ),
// URL in quoted string after multiline quoted string
- array( "var
foo=\"\\\nblah\\\n\";\naNode.setAttribute('href','http://foo.bar.org/baz');",
"var foo=\"\\\nblah\\\n\";aNode.setAttribute('href','http://foo.bar.org/baz');"
),
+ array(
+ "var
foo=\"\\\nblah\\\n\";\naNode.setAttribute('href','http://foo.bar.org/baz');",
+ "var
foo=\"\\\nblah\\\n\";aNode.setAttribute('href','http://foo.bar.org/baz');"
+ ),
// Division vs. regex nastiness
- array( "alert( (10+10) / '/'.charCodeAt( 0 ) + '//'
);", "alert((10+10)/'/'.charCodeAt(0)+'//');" ),
+ array(
+ "alert( (10+10) / '/'.charCodeAt( 0 ) + '//'
);",
+ "alert((10+10)/'/'.charCodeAt(0)+'//');"
+ ),
array( "if(1)/a /g.exec('Pa ss');", "if(1)/a
/g.exec('Pa ss');" ),
// newline insertion after 1000 chars: break after the
"++", not before
@@ -130,7 +157,11 @@
wfRestoreWarnings();
$parser->parse( $minified, 'minify-test.js', 1 );
- $this->assertEquals( $expectedOutput, $minified, "Minified
output should be in the form expected." );
+ $this->assertEquals(
+ $expectedOutput,
+ $minified,
+ "Minified output should be in the form expected."
+ );
}
public static function provideBug32548() {
--
To view, visit https://gerrit.wikimedia.org/r/129455
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits