phpcs: Disable Generic.Files.LineLength for test files
There is a common and reasonable need for longer lines in tests. The nudge for shorter lines doesn't seem valuable here. The natural breaks will likely still fall in 80-100 given the enforced practice for non-test code, e.g. whether through habit, or 80-100 column markers in text editors, or the finite width of diff and code review interfaces. Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
This commit is contained in:
parent
38467129b8
commit
8d406bbcd6
62 changed files with 1 additions and 180 deletions
|
|
@ -60,6 +60,7 @@
|
|||
</rule>
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<exclude-pattern>*/languages/messages/*</exclude-pattern>
|
||||
<exclude-pattern>*/tests/*</exclude-pattern>
|
||||
</rule>
|
||||
<rule ref="MediaWiki.Files.ClassMatchesFilename.NotMatch">
|
||||
<!--
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
global $wgAutoloadClasses;
|
||||
$testDir = __DIR__ . "/..";
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$wgAutoloadClasses += [
|
||||
|
||||
# tests/common
|
||||
|
|
|
|||
|
|
@ -161,7 +161,6 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public function providerMakeCSPDirectives() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ false, '', '' ],
|
||||
[
|
||||
|
|
@ -274,8 +273,6 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
|
|||
$actual = $this->csp->makeCSPDirectives( true, ContentSecurityPolicy::FULL_MODE );
|
||||
|
||||
$wgAllowImageTag = $origImg;
|
||||
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$expected = "script-src 'unsafe-eval' blob: 'self' 'nonce-secret' 'unsafe-inline' sister-site.somewhere.com *.wikipedia.org; default-src * data: blob:; style-src * data: blob: 'unsafe-inline'; object-src 'none'; report-uri /w/api.php?action=cspreport&format=json";
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
|
@ -288,7 +285,6 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
|
|||
true,
|
||||
ContentSecurityPolicy::REPORT_ONLY_MODE
|
||||
);
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$expected = "script-src 'unsafe-eval' blob: 'self' 'nonce-secret' 'unsafe-inline' sister-site.somewhere.com *.wikipedia.org; default-src * data: blob:; style-src * data: blob: 'unsafe-inline'; object-src 'none'; report-uri /w/api.php?action=cspreport&format=json&reportonly=1";
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,8 +308,6 @@ class LinkerTest extends MediaWikiLangTestCase {
|
|||
|
||||
public function provideCasesForFormatComment() {
|
||||
$wikiId = 'enwiki'; // $wgConf has a fake entry for this
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Linker::formatComment
|
||||
[
|
||||
|
|
@ -585,7 +583,6 @@ class LinkerTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public static function provideCasesForFormatLinksInComment() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
|
||||
|
|
@ -693,7 +690,6 @@ class LinkerTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public static function provideCommentBlock() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
' <span class="comment">(Test)</span>',
|
||||
|
|
@ -770,7 +766,6 @@ class LinkerTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public static function provideRevComment() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
'Should be visible' => [
|
||||
' <span class="comment">(Some comment!)</span>'
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
private const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
|
||||
private const SCREEN_ONLY_MEDIA_QUERY = 'only screen and (min-width: 982px)';
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
private const RSS_RC_LINK = '<link rel="alternate" type="application/rss+xml" title=" RSS feed" href="/w/index.php?title=Special:RecentChanges&feed=rss"/>';
|
||||
private const ATOM_RC_LINK = '<link rel="alternate" type="application/atom+xml" title=" Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"/>';
|
||||
|
||||
|
|
@ -2634,7 +2632,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public static function provideMakeResourceLoaderLink() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Single only=scripts load
|
||||
[
|
||||
|
|
@ -2734,7 +2731,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public static function provideBuildExemptModules() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
'empty' => [
|
||||
'exemptStyleModules' => [],
|
||||
|
|
|
|||
|
|
@ -58,10 +58,8 @@ class SampleTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* phpcs:disable Generic.Files.LineLength
|
||||
* @dataProvider provideTitles
|
||||
* See https://phpunit.de/manual/6.5/en/appendixes.annotations.html#appendixes.annotations.dataProvider
|
||||
* phpcs:enable
|
||||
*/
|
||||
public function testCreateBasicListOfTitles( $titleName, $ns, $text ) {
|
||||
$title = Title::newFromText( $titleName, $ns );
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ class ApiComparePagesTest extends ApiTestCase {
|
|||
}
|
||||
|
||||
public static function provideDiff() {
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
return [
|
||||
'Basic diff, titles' => [
|
||||
[
|
||||
|
|
|
|||
|
|
@ -1118,7 +1118,6 @@ class ApiMainTest extends ApiTestCase {
|
|||
[ 'code' => 'sv-error2', 'text' => 'Another error', 'module' => 'foo+bar' ],
|
||||
],
|
||||
'docref' => "See $doclink for API usage. Subscribe to the mediawiki-api-announce mailing " .
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
"list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> " .
|
||||
"for notice of API deprecations and breaking changes.",
|
||||
'servedby' => wfHostname(),
|
||||
|
|
@ -1136,7 +1135,6 @@ class ApiMainTest extends ApiTestCase {
|
|||
[ 'code' => "bad\nvalue", 'text' => 'An error' ],
|
||||
],
|
||||
'docref' => "See $doclink for API usage. Subscribe to the mediawiki-api-announce mailing " .
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
"list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> " .
|
||||
"for notice of API deprecations and breaking changes.",
|
||||
'servedby' => wfHostname(),
|
||||
|
|
|
|||
|
|
@ -249,7 +249,6 @@ class SubmoduleDefTest extends TypeDefTestCase {
|
|||
'internalvalues' => [ 'depint', 'int' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>[[Special:ApiHelp/testmod+mod1|<span dir="ltr" lang="en">mod1</span>]]</text><text>[[Special:ApiHelp/testmod+mod2|<span dir="ltr" lang="en">mod2</span>]]</text><text>[[Special:ApiHelp/testmod+recurse|<span dir="ltr" lang="en">recurse</span>]]</text><text>[[Special:ApiHelp/testmod+dep|<span dir="ltr" lang="en" class="apihelp-deprecated-value">dep</span>]]</text><text>[[Special:ApiHelp/testmod+int|<span dir="ltr" lang="en" class="apihelp-internal-value">int</span>]]</text><text>[[Special:ApiHelp/testmod+depint|<span dir="ltr" lang="en" class="apihelp-deprecated-value apihelp-internal-value">depint</span>]]</text></list><num>6</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -277,7 +276,6 @@ class SubmoduleDefTest extends TypeDefTestCase {
|
|||
'deprecatedvalues' => [ 'xyz' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>2</text><list listType="comma"><text>[[Special:ApiHelp/testmod+mod3|<span dir="ltr" lang="en">mod3</span>]]</text><text>[[Special:ApiHelp/testmod+mod4|<span dir="ltr" lang="en">mod4</span>]]</text><text>[[Special:ApiHelp/testmod+dep|<span dir="ltr" lang="en" class="apihelp-deprecated-value">xyz</span>]]</text></list><num>3</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ class ApiFormatBaseTest extends ApiFormatTestBase {
|
|||
],
|
||||
'wrapped HTML format' => [
|
||||
[],
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'{"status":200,"statustext":"OK","html":"<pre class=\"api-pretty-content\">Format MOCK: <b>ok</b></pre>","modules":["mediawiki.apipretty"],"continue":null,"time":1234}',
|
||||
[ 'wrappedhtml' => 1 ],
|
||||
[ 'name' => 'mockfm' ]
|
||||
|
|
@ -143,14 +142,12 @@ class ApiFormatBaseTest extends ApiFormatTestBase {
|
|||
],
|
||||
'wrapped HTML format, with set status' => [
|
||||
[],
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'{"status":400,"statustext":"Bad Request","html":"<pre class=\"api-pretty-content\">Format MOCK: <b>ok</b></pre>","modules":["mediawiki.apipretty"],"continue":null,"time":1234}',
|
||||
[ 'wrappedhtml' => 1 ],
|
||||
[ 'name' => 'mockfm', 'status' => 400 ]
|
||||
],
|
||||
'wrapped HTML format, cross-domain-policy' => [
|
||||
[ 'continue' => '< CrOsS-DoMaIn-PoLiCy >' ],
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'{"status":200,"statustext":"OK","html":"<pre class=\"api-pretty-content\">Format MOCK: <b>ok</b></pre>","modules":["mediawiki.apipretty"],"continue":"\u003C CrOsS-DoMaIn-PoLiCy \u003E","time":1234}',
|
||||
[ 'wrappedhtml' => 1 ],
|
||||
[ 'name' => 'mockfm' ]
|
||||
|
|
@ -399,7 +396,6 @@ class ApiFormatBaseTest extends ApiFormatTestBase {
|
|||
return [
|
||||
[ false, false, '(api-format-prettyprint-header-only-html: MOCK)' ],
|
||||
[ true, false, '(api-format-prettyprint-header-only-html: MOCK)' ],
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
[ false, true, '(api-format-prettyprint-header-hyperlinked: MOCK, mock, <a rel="nofollow" class="external free" href="http://example.org/wx/api.php?a=1&b=2&format=mock">http://example.org/wx/api.php?a=1&b=2&format=mock</a>)' ],
|
||||
[ true, true, '(api-format-prettyprint-header: MOCK, mock)' ],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
|
|||
}
|
||||
|
||||
public static function provideGeneralEncoding() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return array_merge(
|
||||
self::addFormatVersion( 1, [
|
||||
// Basic types
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class ApiFormatXmlTest extends ApiFormatTestBase {
|
|||
parent::setUpBeforeClass();
|
||||
$page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest.xsl' ) );
|
||||
$user = self::getTestSysop()->getUser();
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$page->doUserEditContent( new WikitextContent(
|
||||
'<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />'
|
||||
), $user, 'Summary' );
|
||||
|
|
@ -25,7 +24,6 @@ class ApiFormatXmlTest extends ApiFormatTestBase {
|
|||
}
|
||||
|
||||
public static function provideGeneralEncoding() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Basic types
|
||||
[ [ null, 'a' => null ], '<?xml version="1.0"?><api><_v _idx="0" /></api>' ],
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ class CssContentHandlerTest extends MediaWikiLangTestCase {
|
|||
* Keep this in sync with CssContentTest::provideGetRedirectTarget()
|
||||
*/
|
||||
public static function provideMakeRedirectContent() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'MediaWiki:MonoBook.css',
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ class CssContentTest extends TextContentTest {
|
|||
* Keep this in sync with CssContentHandlerTest::provideMakeRedirectContent()
|
||||
*/
|
||||
public static function provideGetRedirectTarget() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ],
|
||||
[ 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ],
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ class JavaScriptContentHandlerTest extends MediaWikiLangTestCase {
|
|||
* Keep this in sync with JavaScriptContentTest::provideGetRedirectTarget()
|
||||
*/
|
||||
public static function provideMakeRedirectContent() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'MediaWiki:MonoBook.js',
|
||||
|
|
|
|||
|
|
@ -223,7 +223,6 @@ class JavaScriptContentTest extends TextContentTest {
|
|||
}
|
||||
|
||||
public static function provideUpdateRedirect() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'#REDIRECT [[Someplace]]',
|
||||
|
|
@ -284,7 +283,6 @@ class JavaScriptContentTest extends TextContentTest {
|
|||
* Keep this in sync with JavaScriptContentHandlerTest::provideMakeRedirectContent()
|
||||
*/
|
||||
public static function provideGetRedirectTarget() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'MediaWiki:MonoBook.js',
|
||||
|
|
|
|||
|
|
@ -522,31 +522,26 @@ class LocalFileTest extends MediaWikiIntegrationTestCase {
|
|||
public function provideLoadFromDBAndCache() {
|
||||
return [
|
||||
'legacy' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:16;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:2:{s:8:"DateTime";s:19:"2019:07:30 13:52:32";s:15:"_MW_PNG_VERSION";i:1;}}',
|
||||
[],
|
||||
false,
|
||||
],
|
||||
'json' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'{"data":{"frameCount":0,"loopCount":1,"duration":0,"bitDepth":16,"colorType":"truecolour","metadata":{"DateTime":"2019:07:30 13:52:32","_MW_PNG_VERSION":1}}}',
|
||||
[],
|
||||
false,
|
||||
],
|
||||
'json with blobs' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'{"blobs":{"colorType":"__BLOB0__"},"data":{"frameCount":0,"loopCount":1,"duration":0,"bitDepth":16,"metadata":{"DateTime":"2019:07:30 13:52:32","_MW_PNG_VERSION":1}}}',
|
||||
[ '"truecolour"' ],
|
||||
false,
|
||||
],
|
||||
'large (>100KB triggers uncached case)' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'{"data":{"large":"' . str_repeat( 'x', 102401 ) . '","frameCount":0,"loopCount":1,"duration":0,"bitDepth":16,"colorType":"truecolour","metadata":{"DateTime":"2019:07:30 13:52:32","_MW_PNG_VERSION":1}}}',
|
||||
[],
|
||||
102401,
|
||||
],
|
||||
'large json blob' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'{"blobs":{"large":"__BLOB0__"},"data":{"frameCount":0,"loopCount":1,"duration":0,"bitDepth":16,"colorType":"truecolour","metadata":{"DateTime":"2019:07:30 13:52:32","_MW_PNG_VERSION":1}}}',
|
||||
[ '"' . str_repeat( 'x', 102401 ) . '"' ],
|
||||
102401,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class ImportTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public function getUnknownTagsXML() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
<<< EOF
|
||||
|
|
@ -97,7 +96,6 @@ EOF
|
|||
}
|
||||
|
||||
public function getRedirectXML() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
<<< EOF
|
||||
|
|
@ -179,7 +177,6 @@ EOF
|
|||
}
|
||||
|
||||
public function getSiteInfoXML() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
<<< EOF
|
||||
|
|
@ -244,8 +241,6 @@ EOF
|
|||
$user = $this->getTestUser()->getUser();
|
||||
|
||||
$n = ( $assign ? 1 : 0 ) + ( $create ? 2 : 0 );
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$source = new ImportStringSource( <<<EOF
|
||||
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
|
||||
<page>
|
||||
|
|
|
|||
|
|
@ -35,18 +35,15 @@ class ExifBitmapTest extends MediaWikiMediaTestCase {
|
|||
ExifBitmapHandler::METADATA_BAD
|
||||
],
|
||||
'good' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}',
|
||||
ExifBitmapHandler::METADATA_GOOD
|
||||
],
|
||||
'old good' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}',
|
||||
ExifBitmapHandler::METADATA_COMPATIBLE
|
||||
],
|
||||
// Handle metadata from paged tiff handler (gotten via instant commons) gracefully.
|
||||
'paged tiff' => [
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}',
|
||||
ExifBitmapHandler::METADATA_BAD
|
||||
],
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ class GIFHandlerTest extends MediaWikiMediaTestCase {
|
|||
}
|
||||
|
||||
public function provideIsFileMetadataValid() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ '0', GIFHandler::METADATA_GOOD ],
|
||||
[ '', GIFHandler::METADATA_BAD ],
|
||||
|
|
@ -107,7 +106,6 @@ class GIFHandlerTest extends MediaWikiMediaTestCase {
|
|||
}
|
||||
|
||||
public static function provideGetSizeAndMetadata() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'nonanimated.gif',
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ class PNGHandlerTest extends MediaWikiMediaTestCase {
|
|||
}
|
||||
|
||||
public function provideIsMetadataValid() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ '0', PNGHandler::METADATA_GOOD ],
|
||||
[ '', PNGHandler::METADATA_BAD ],
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ class SVGReaderTest extends \MediaWikiIntegrationTestCase {
|
|||
|
||||
public static function provideSvgFilesWithXMLMetadata() {
|
||||
$base = __DIR__ . '/../../data/media';
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$metadata = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
|
||||
<ns5:format xmlns:ns5="http://purl.org/dc/elements/1.1/">image/svg+xml</ns5:format>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class WebPHandlerTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public function provideTestExtractMetaData() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Files from https://developers.google.com/speed/webp/gallery2
|
||||
[ "\x52\x49\x46\x46\x90\x68\x01\x00\x57\x45\x42\x50\x56\x50\x38\x4C\x83\x68\x01\x00\x2F\x8F\x01\x4B\x10\x8D\x38\x6C\xDB\x46\x92\xE0\xE0\x82\x7B\x6C",
|
||||
|
|
|
|||
|
|
@ -903,9 +903,7 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
|
|||
[
|
||||
'WikiPageTest_testGetRedirectTarget_4',
|
||||
CONTENT_MODEL_WIKITEXT,
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'#REDIRECT [[Foobar#🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴]]',
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'Foobar#🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴🏴...'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -258,7 +258,6 @@ class ParserOutputTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public static function provideGetTextToC() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$toc = <<<EOF
|
||||
<div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
|
||||
<ul>
|
||||
|
|
@ -278,7 +277,6 @@ EOF;
|
|||
|
||||
// REMOVE THIS ONCE Parser::TOC_START IS REMOVED
|
||||
public static function provideGetTextBackCompat() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$toc = self::provideGetTextToc();
|
||||
$text = <<<EOF
|
||||
<p>Test document.
|
||||
|
|
@ -383,7 +381,6 @@ EOF
|
|||
}
|
||||
|
||||
public static function provideGetText() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$toc = self::provideGetTextToc();
|
||||
$text = <<<EOF
|
||||
<p>Test document.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ class PreprocessorTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public static function provideCases() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ "Foo", "<root>Foo</root>" ],
|
||||
[ "<!-- Foo -->", "<root><comment><!-- Foo --></comment></root>" ],
|
||||
|
|
@ -185,7 +184,6 @@ class PreprocessorTest extends MediaWikiIntegrationTestCase {
|
|||
* These are more complex test cases taken out of wiki articles.
|
||||
*/
|
||||
public static function provideFiles() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ "QuoteQuran" ], # https://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC BY-SA by Striver
|
||||
[ "Factorial" ], # https://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC BY-SA by Polonium
|
||||
|
|
@ -219,7 +217,6 @@ class PreprocessorTest extends MediaWikiIntegrationTestCase {
|
|||
* Tests from T30642 · https://phabricator.wikimedia.org/T30642
|
||||
*/
|
||||
public static function provideHeadings() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
/* These should become headings: */
|
||||
[ "== h ==<!--c1-->", "<root><h level=\"2\" i=\"1\">== h ==<comment><!--c1--></comment></h></root>" ],
|
||||
|
|
|
|||
|
|
@ -102,8 +102,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
$client->setExemptStates( [
|
||||
'test.exempt' => 'ready',
|
||||
] );
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>'
|
||||
. 'document.documentElement.className="client-js";'
|
||||
. 'RLCONF={"key":"value"};'
|
||||
|
|
@ -130,8 +128,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
self::makeContext(),
|
||||
[ 'target' => 'example' ]
|
||||
);
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className="client-js";</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&raw=1&target=example"></script>';
|
||||
// phpcs:enable
|
||||
|
|
@ -147,8 +143,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
self::makeContext(),
|
||||
[ 'safemode' => '1' ]
|
||||
);
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className="client-js";</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&raw=1&safemode=1"></script>';
|
||||
// phpcs:enable
|
||||
|
|
@ -164,8 +158,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
self::makeContext(),
|
||||
[ 'target' => null ]
|
||||
);
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className="client-js";</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&raw=1"></script>';
|
||||
// phpcs:enable
|
||||
|
|
@ -186,7 +178,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
$client->setModuleStyles( [
|
||||
'test.styles.deprecated',
|
||||
] );
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>(RLQ=window.RLQ||[]).push(function(){'
|
||||
. 'mw.log.warn("This page is using the deprecated ResourceLoader module \"test.styles.deprecated\".\nDeprecation message.");'
|
||||
. '});</script>';
|
||||
|
|
@ -196,7 +187,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
|
|||
}
|
||||
|
||||
public static function provideMakeLoad() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'context' => [],
|
||||
|
|
|
|||
|
|
@ -163,7 +163,6 @@ class ResourceLoaderSkinModuleTest extends ResourceLoaderTestCase {
|
|||
}
|
||||
|
||||
public static function provideGetStyles() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'parent' => [],
|
||||
|
|
|
|||
|
|
@ -138,7 +138,6 @@ class UploadBaseTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public static function provideCheckSvgScriptCallback() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// html5sec SVG vectors
|
||||
[
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ class MWCryptHKDFTest extends MediaWikiIntegrationTestCase {
|
|||
* Test vectors from Appendix A on https://tools.ietf.org/html/rfc5869
|
||||
*/
|
||||
public static function providerRfc5869() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// A.1
|
||||
[
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ class CommentParserTest extends \MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function provideFormatComment() {
|
||||
$wikiId = 'enwiki'; // $wgConf has a fake entry for this
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Linker::formatComment
|
||||
[
|
||||
|
|
@ -319,7 +317,6 @@ class CommentParserTest extends \MediaWikiIntegrationTestCase {
|
|||
* Adapted from LinkerTest
|
||||
*/
|
||||
public static function provideFormatLinksInComment() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
|
||||
|
|
@ -390,7 +387,6 @@ class CommentParserTest extends \MediaWikiIntegrationTestCase {
|
|||
] );
|
||||
$expected = [
|
||||
'<a href="/index.php/Present" title="Present">Present</a>',
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'<a href="/index.php?title=Absent&action=edit&redlink=1" class="new" title="Absent (page does not exist)">Absent</a>'
|
||||
];
|
||||
$this->assertSame( $expected, $result );
|
||||
|
|
|
|||
|
|
@ -1363,7 +1363,6 @@ class LanguageIntegrationTest extends LanguageClassesTestCase {
|
|||
}
|
||||
|
||||
public static function provideCheckTitleEncodingData() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[ "" ],
|
||||
[ "United States of America" ], // 7bit ASCII
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ class BaseDumpTest extends MediaWikiIntegrationTestCase {
|
|||
$fname = $this->getNewTempFile();
|
||||
|
||||
// The header of every prefetch file
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$header = '<mediawiki>
|
||||
<siteinfo>
|
||||
<sitename>wikisvn</sitename>
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ class NamespaceDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[ 'type' => 'namespace' ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>0</text><text>1</text><text>2</text><text>3</text><text>4</text><text>5</text><text>6</text><text>7</text><text>8</text><text>9</text><text>10</text><text>11</text><text>12</text><text>13</text><text>14</text><text>15</text></list><num>16</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -275,7 +274,6 @@ class NamespaceDefTest extends TypeDefTestCase {
|
|||
],
|
||||
[ 'type' => 'namespace', 'extranamespaces' => [ NS_SPECIAL, NS_MEDIA ] ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>-1</text><text>-2</text><text>0</text><text>1</text><text>2</text><text>3</text><text>4</text><text>5</text><text>6</text><text>7</text><text>8</text><text>9</text><text>10</text><text>11</text><text>12</text><text>13</text><text>14</text><text>15</text></list><num>18</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -291,7 +289,6 @@ class NamespaceDefTest extends TypeDefTestCase {
|
|||
],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>-1</text><text>-2</text><text>0</text><text>1</text><text>2</text><text>3</text><text>4</text><text>5</text><text>6</text><text>7</text><text>8</text><text>9</text><text>10</text><text>11</text><text>12</text><text>13</text><text>14</text><text>15</text></list><num>18</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -364,7 +364,6 @@ class UserDefTest extends TypeDefTestCase {
|
|||
'subtypes' => [ 'name', 'ip', 'cidr', 'interwiki' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-user"><text>1</text><list listType="text"><text><message key="paramvalidator-help-type-user-subtype-name"></message></text><text><message key="paramvalidator-help-type-user-subtype-ip"></message></text><text><message key="paramvalidator-help-type-user-subtype-cidr"></message></text><text><message key="paramvalidator-help-type-user-subtype-interwiki"></message></text></list><num>4</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -378,7 +377,6 @@ class UserDefTest extends TypeDefTestCase {
|
|||
'subtypes' => [ 'name', 'id' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-user"><text>2</text><list listType="text"><text><message key="paramvalidator-help-type-user-subtype-name"></message></text><text><message key="paramvalidator-help-type-user-subtype-id"></message></text></list><num>2</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
|
||||
/**
|
||||
* @covers LCStoreStaticArray
|
||||
|
|
|
|||
|
|
@ -335,7 +335,6 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
],
|
||||
[
|
||||
'issues' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT2 => 'PARAM_ISMULTI_LIMIT2 must be greater than or equal to PARAM_ISMULTI_LIMIT1, but 10 < 100',
|
||||
],
|
||||
'allowedKeys' => $multiKeys,
|
||||
|
|
@ -1093,7 +1092,6 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
[
|
||||
ParamValidator::PARAM_DEPRECATED => '<message key="paramvalidator-help-deprecated"></message>',
|
||||
ParamValidator::PARAM_REQUIRED => '<message key="paramvalidator-help-required"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_DEFAULT => '<message key="paramvalidator-help-default"><plaintext>1234</plaintext></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1105,13 +1103,9 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_DEFAULT => '',
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max"><num>50</num><num>500</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ALL => '<message key="paramvalidator-help-multi-all"><plaintext>*</plaintext></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_DEFAULT => '<message key="paramvalidator-help-default-empty"></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1120,9 +1114,7 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ISMULTI => true,
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max"><num>50</num><num>500</num></message>',
|
||||
],
|
||||
[],
|
||||
|
|
@ -1136,11 +1128,8 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ALL => 'all',
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max"><num>10</num><num>15</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ALL => '<message key="paramvalidator-help-multi-all"><plaintext>all</plaintext></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1150,9 +1139,7 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ISMULTI_LIMIT2 => 10,
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max-simple"><num>50</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1164,7 +1151,6 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ISMULTI_LIMIT2 => 2,
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1176,9 +1162,7 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ISMULTI_LIMIT2 => 10,
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max"><num>4</num><num>10</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1191,9 +1175,7 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
ParamValidator::PARAM_ALLOW_DUPLICATES => true,
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI => '<message key="paramvalidator-help-multi-separate"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max-simple"><num>4</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -1206,10 +1188,8 @@ class ParamValidatorTest extends \PHPUnit\Framework\TestCase {
|
|||
[
|
||||
ParamValidator::PARAM_REQUIRED => '<message key="paramvalidator-help-required"></message>',
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-help"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_ISMULTI_LIMIT1 => '<message key="paramvalidator-help-multi-max"><num>50</num><num>500</num></message>',
|
||||
'foobar' => '<message key="foobaz"></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_DEFAULT => '<message key="paramvalidator-help-default"><text>XX</text></message>',
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class BooleanDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-boolean"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -67,7 +66,6 @@ class BooleanDefTest extends TypeDefTestCase {
|
|||
[ ParamValidator::PARAM_ISMULTI => true ],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-boolean"><text>2</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
[
|
||||
'issues' => [
|
||||
'X',
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
'Values in PARAM_DEPRECATED_VALUES must be null, true, or MessageValue, but value for "c" is false',
|
||||
'Values in PARAM_DEPRECATED_VALUES must be null, true, or MessageValue, but value for "f" is string',
|
||||
'Values in PARAM_DEPRECATED_VALUES must be null, true, or MessageValue, but value for "g" is ' . static::class,
|
||||
|
|
@ -161,7 +160,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
'type' => [ 'a', 'b', 'c', 'd' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>a</text><text>b</text><text>c</text><text>d</text></list><num>4</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -175,7 +173,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
'type' => [ 'a', 'b', 'c', 'd' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>2</text><list listType="comma"><text>a</text><text>b</text><text>c</text><text>d</text></list><num>4</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -190,7 +187,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
'deprecatedvalues' => [ 'b', 'c' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>a</text><text>d</text><text>b</text><text>c</text></list><num>4</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -204,7 +200,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
'type' => [ 'a', 'b', 'c', 'd' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><list listType="comma"><text>a</text><text>b</text><text>c</text><text>d</text></list><num>4</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
@ -217,7 +212,6 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
'type' => [ '', 'a', 'b', 'c', 'd' ],
|
||||
],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-enum"><text>1</text><text><message key="paramvalidator-help-type-enum-can-be-empty"><list listType="comma"><text>a</text><text>b</text><text>c</text><text>d</text></list><num>4</num></message></text><num>5</num></message>',
|
||||
ParamValidator::PARAM_ISMULTI => null,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ class ExpiryDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'param-type' => '<message key="paramvalidator-help-type-expiry"><text>1</text><list listType="text"><text>"infinite"</text><text>"indefinite"</text><text>"infinity"</text><text>"never"</text></list></message>'
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ class FloatDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[ 'min' => null, 'max' => null ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-float"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -172,9 +171,7 @@ class FloatDefTest extends TypeDefTestCase {
|
|||
],
|
||||
[ 'min' => 1, 'max' => 100 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
FloatDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-minmax"><text>2</text><num>1</num><num>100</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-float"><text>2</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -264,7 +264,6 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[ 'min' => null, 'max' => null ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -272,9 +271,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MIN => 0, ParamValidator::PARAM_ISMULTI => true ],
|
||||
[ 'min' => 0, 'max' => null ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-min"><text>2</text><num>0</num><text>∞</text></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>2</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -282,9 +279,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MAX => 2 ],
|
||||
[ 'min' => null, 'max' => 2 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-max"><text>1</text><text>−∞</text><num>2</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -292,9 +287,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MAX => 2, IntegerDef::PARAM_MAX2 => 4 ],
|
||||
[ 'min' => null, 'max' => 2, 'highmax' => 4 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-max"><text>1</text><text>−∞</text><num>2</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -302,9 +295,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MAX => 2, IntegerDef::PARAM_MAX2 => 4 ],
|
||||
[ 'min' => null, 'max' => 2, 'highmax' => 4 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-max"><text>1</text><text>−∞</text><num>4</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
[ 'useHighLimits' => true ],
|
||||
|
|
@ -313,9 +304,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MIN => 0, IntegerDef::PARAM_MAX => 2 ],
|
||||
[ 'min' => 0, 'max' => 2 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-minmax"><text>1</text><num>0</num><num>2</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -323,9 +312,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
[ IntegerDef::PARAM_MIN => 0, IntegerDef::PARAM_MAX => 2, IntegerDef::PARAM_MAX2 => 4 ],
|
||||
[ 'min' => 0, 'max' => 2, 'highmax' => 4 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-minmax"><text>1</text><num>0</num><num>2</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -336,9 +323,7 @@ class IntegerDefTest extends TypeDefTestCase {
|
|||
],
|
||||
[ 'min' => 0, 'max' => 2, 'highmax' => 4 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
IntegerDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-minmax"><text>2</text><num>0</num><num>4</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-integer"><text>2</text></message>',
|
||||
],
|
||||
[ 'useHighLimits' => true ],
|
||||
|
|
|
|||
|
|
@ -175,9 +175,7 @@ class LimitDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[ 'min' => 0, 'max' => null ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
LimitDef::PARAM_MIN => '<message key="paramvalidator-help-type-number-min"><text>1</text><num>0</num><text>∞</text></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-limit"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@ class PresenceBooleanDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[ 'default' => null ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-presenceboolean"><text>1</text></message>',
|
||||
ParamValidator::PARAM_DEFAULT => null,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -153,9 +153,7 @@ class StringDefTest extends TypeDefTestCase {
|
|||
[
|
||||
'issues' => [
|
||||
'X',
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'PARAM_REQUIRED is set, allowEmptyWhenRequired is not set, and PARAM_MAX_BYTES is 0. That\'s impossible to satisfy.',
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
'PARAM_REQUIRED is set, allowEmptyWhenRequired is not set, and PARAM_MAX_CHARS is 0. That\'s impossible to satisfy.',
|
||||
],
|
||||
'allowedKeys' => $keys,
|
||||
|
|
@ -208,9 +206,7 @@ class StringDefTest extends TypeDefTestCase {
|
|||
],
|
||||
[ 'maxbytes' => 4, 'maxchars' => 2 ],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
StringDef::PARAM_MAX_BYTES => '<message key="paramvalidator-help-type-string-maxbytes"><num>4</num></message>',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
StringDef::PARAM_MAX_CHARS => '<message key="paramvalidator-help-type-string-maxchars"><num>2</num></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -193,7 +193,6 @@ class TimestampDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-timestamp"><text>1</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
@ -201,7 +200,6 @@ class TimestampDefTest extends TypeDefTestCase {
|
|||
[ ParamValidator::PARAM_ISMULTI => true ],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-timestamp"><text>2</text></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ class UploadDefTest extends TypeDefTestCase {
|
|||
[],
|
||||
[],
|
||||
[
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
ParamValidator::PARAM_TYPE => '<message key="paramvalidator-help-type-upload"></message>',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -74,17 +74,14 @@ class TypeDefTest extends \PHPUnit\Framework\TestCase {
|
|||
public static function provideFailureMessage() {
|
||||
return [
|
||||
'Basic' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'<datamessage key="paramvalidator-foobar" code="foobar"></datamessage>',
|
||||
'foobar',
|
||||
],
|
||||
'With data' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'<datamessage key="paramvalidator-foobar" code="foobar"><data>{"x":123}</data></datamessage>',
|
||||
'foobar', [ 'x' => 123 ]
|
||||
],
|
||||
'With suffix' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'<datamessage key="paramvalidator-foobar-baz" code="foobar"><data>[]</data></datamessage>',
|
||||
'foobar', [], 'baz'
|
||||
],
|
||||
|
|
@ -139,12 +136,10 @@ class TypeDefTest extends \PHPUnit\Framework\TestCase {
|
|||
public static function provideFailure() {
|
||||
return [
|
||||
'Basic' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'<datamessage key="paramvalidator-foobar" code="foobar"><params><plaintext>test</plaintext><plaintext>1234</plaintext></params></datamessage>',
|
||||
'foobar', 'test', 1234, [], []
|
||||
],
|
||||
'DataMessageValue' => [
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'<datamessage key="XXX-msg" code="foobar"><params><plaintext>test</plaintext><plaintext>XXX</plaintext><text>a</text><text>b</text><plaintext>pt</plaintext></params><data>{"data":"!!!"}</data></datamessage>',
|
||||
DataMessageValue::new( 'XXX-msg', [ 'a', 'b' ], 'foobar', [ 'data' => '!!!' ] )
|
||||
->plaintextParams( 'pt' ),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ class XmlTypeCheckTest extends PHPUnit\Framework\TestCase {
|
|||
|
||||
private const WELL_FORMED_XML = "<root><child /></root>";
|
||||
private const MAL_FORMED_XML = "<root><child /></error>";
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
private const XML_WITH_PIH = '<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/w/index.php"?><svg><child /></svg>';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ class SetCookieCompatTest extends TestCase {
|
|||
|
||||
public static function provideSetCookieEmulated() {
|
||||
// Expected values are all copied from PHP 7.4
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
return [
|
||||
'unrecognised key' => [
|
||||
true, 'a', '',
|
||||
|
|
|
|||
|
|
@ -1273,7 +1273,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
}
|
||||
|
||||
public static function provideUnionConditionPermutations() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
[
|
||||
|
|
@ -1724,21 +1723,18 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE );
|
||||
$this->database->endAtomic( __METHOD__ );
|
||||
$this->database->commit( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; RELEASE SAVEPOINT wikimedia_rdbms_atomic1; COMMIT' );
|
||||
|
||||
$this->database->begin( __METHOD__ );
|
||||
$this->database->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE );
|
||||
$this->database->cancelAtomic( __METHOD__ );
|
||||
$this->database->commit( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; COMMIT' );
|
||||
|
||||
$this->database->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE );
|
||||
$this->database->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE );
|
||||
$this->database->cancelAtomic( __METHOD__ );
|
||||
$this->database->endAtomic( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; COMMIT' );
|
||||
|
||||
$noOpCallack = static function () {
|
||||
|
|
@ -1753,7 +1749,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->begin( __METHOD__ );
|
||||
$this->database->doAtomicSection( __METHOD__, $noOpCallack, IDatabase::ATOMIC_CANCELABLE );
|
||||
$this->database->rollback( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; RELEASE SAVEPOINT wikimedia_rdbms_atomic1; ROLLBACK' );
|
||||
|
||||
$fname = __METHOD__;
|
||||
|
|
@ -1954,7 +1949,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->assertSame( 'Test exception', $ex->getMessage() );
|
||||
}
|
||||
$this->database->commit( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; COMMIT' );
|
||||
|
||||
$this->database->begin( __METHOD__ );
|
||||
|
|
@ -2033,7 +2027,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->assertNull( $callback2Called );
|
||||
$this->assertEquals( IDatabase::TRIGGER_ROLLBACK, $callback3Called );
|
||||
$this->assertSame( 1, $callback4Called );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; SELECT 4; COMMIT; SELECT 3' );
|
||||
|
||||
$callback1Called = null;
|
||||
|
|
@ -2054,7 +2047,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->assertNull( $callback2Called );
|
||||
$this->assertEquals( IDatabase::TRIGGER_ROLLBACK, $callback3Called );
|
||||
$this->assertSame( 1, $callback4Called );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; SAVEPOINT wikimedia_rdbms_atomic2; RELEASE SAVEPOINT wikimedia_rdbms_atomic2; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; SELECT 4; COMMIT; SELECT 3' );
|
||||
|
||||
$callback1Called = null;
|
||||
|
|
@ -2113,7 +2105,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->cancelAtomic( __METHOD__ . '_inner' );
|
||||
$this->database->cancelAtomic( __METHOD__ );
|
||||
$this->database->endAtomic( __METHOD__ . '_outer' );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; SAVEPOINT wikimedia_rdbms_atomic2; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic2; SELECT 4; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; SELECT 5; COMMIT' );
|
||||
$this->assertSame( 1, $callback4Called );
|
||||
$this->assertSame( 1, $callback5Called );
|
||||
|
|
@ -2128,7 +2119,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->endAtomic( __METHOD__ . '_inner' );
|
||||
$this->database->cancelAtomic( __METHOD__ );
|
||||
$this->database->endAtomic( __METHOD__ . '_outer' );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; SAVEPOINT wikimedia_rdbms_atomic2; RELEASE SAVEPOINT wikimedia_rdbms_atomic2; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; SELECT 5; SELECT 4; COMMIT' );
|
||||
$this->assertSame( 1, $callback4Called );
|
||||
$this->assertSame( 1, $callback5Called );
|
||||
|
|
@ -2142,7 +2132,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->onAtomicSectionCancel( $callback4, __METHOD__ );
|
||||
$this->database->cancelAtomic( __METHOD__, $sectionId );
|
||||
$this->database->endAtomic( __METHOD__ . '_outer' );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; SAVEPOINT wikimedia_rdbms_atomic2; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; SELECT 5; SELECT 4; COMMIT' );
|
||||
$this->assertSame( 1, $callback4Called );
|
||||
$this->assertSame( 1, $callback5Called );
|
||||
|
|
@ -2184,7 +2173,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->query( 'SELECT 1', __METHOD__ );
|
||||
$this->database->endAtomic( __METHOD__ );
|
||||
$this->database->commit( __METHOD__, IDatabase::FLUSHING_ALL_PEERS );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; SELECT 1; RELEASE SAVEPOINT wikimedia_rdbms_atomic1; COMMIT' );
|
||||
}
|
||||
|
||||
|
|
@ -2308,7 +2296,6 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
|
|||
$this->database->delete( 'y', [ 'field' => 1 ], __METHOD__ );
|
||||
$this->database->endAtomic( __METHOD__ );
|
||||
$this->database->commit( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$this->assertLastSql( 'BEGIN; SAVEPOINT wikimedia_rdbms_atomic1; UPDATE y SET a = 1 WHERE field = 1; ROLLBACK TO SAVEPOINT wikimedia_rdbms_atomic1; DELETE FROM y WHERE field = 1; COMMIT' );
|
||||
$this->assertSame( 0, $this->database->trxLevel(), 'Use after rollback()' );
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,6 @@ class SelectQueryBuilderTest extends PHPUnit\Framework\TestCase {
|
|||
public function testFetchRowCountWithField() {
|
||||
$this->sqb->table( 't' )->field( 'f' )->caller( __METHOD__ );
|
||||
$this->sqb->fetchRowCount();
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
$this->assertEquals( 'SELECT COUNT(*) AS rowcount FROM (SELECT 1 FROM t WHERE (f IS NOT NULL) ) tmp_count',
|
||||
$this->db->getLastSqls() );
|
||||
}
|
||||
|
|
@ -525,7 +524,6 @@ class SelectQueryBuilderTest extends PHPUnit\Framework\TestCase {
|
|||
$this->db->begin( __METHOD__ );
|
||||
$this->sqb->lockForUpdate();
|
||||
$this->db->rollback( __METHOD__ );
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
$this->assertEquals( 'BEGIN; SELECT COUNT(*) AS rowcount FROM (SELECT 1 FROM t WHERE a = \'b\' FOR UPDATE) tmp_count; ROLLBACK',
|
||||
$this->db->getLastSqls() );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
* @covers Argon2Password
|
||||
* @covers Password
|
||||
* @covers ParameterizedPassword
|
||||
*
|
||||
* @phpcs:disable Generic.Files.LineLength
|
||||
*/
|
||||
class Argon2PasswordTest extends PasswordTestCase {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class BcryptPasswordTest extends PasswordTestCase {
|
|||
}
|
||||
|
||||
public static function providePasswordTests() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Tests from glibc bcrypt implementation
|
||||
[ true, ':bcrypt:5$CCCCCCCCCCCCCCCCCCCCC.$E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', "U*U" ],
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ class EncryptedPasswordTest extends PasswordTestCase {
|
|||
}
|
||||
|
||||
public static function providePasswordTests() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
// Encrypted with secret1
|
||||
[ true, ':both:aes-256-cbc:0:izBpxujqC1YbzpCB3qAzgg==:ZqHnitT1pL4YJqKqFES2KEevZYSy2LtlibW5+IMi4XKOGKGy6sE638BXyBbLQQsBtTSrt+JyzwOayKtwIfRbaQsBridx/O1JwBSai1TkGkOsYMBXnlu2Bu/EquCBj5QpjYh7p3Uq4rpiop1KQlin1BJMwnAa1PovhxjpxnYhlhkM4X5ALoGi3XM0bapN48vt', 'password' ],
|
||||
|
|
@ -61,7 +60,6 @@ class EncryptedPasswordTest extends PasswordTestCase {
|
|||
* Wrong encryption key selected
|
||||
*/
|
||||
public function testDecryptionError() {
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$hash = ':secret1:aes-256-cbc:0:m1LCnQVIakfYBNlr9KEgQg==:5yPTctqrzsybdgaMEag18AZYbnL37pAtXVBqmWxkjXbnNmiDH+1bHoL8lsEVTH/sJntC82kNVgE7zeiD8xUVLYF2VUnvB5+sU+aysE45/zwsCu7a22TaischMAOWrsHZ/tIgS/TnZY2d+HNyxgsEeeYf/QoL+FhmqHquK02+4SRbA5lLuj9niYy1r5CoM9cQ';
|
||||
$password = $this->passwordFactory->newFromCiphertext( $hash );
|
||||
$this->expectException( PasswordError::class );
|
||||
|
|
@ -69,7 +67,6 @@ class EncryptedPasswordTest extends PasswordTestCase {
|
|||
}
|
||||
|
||||
public function testUpdate() {
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$hash = ':both:aes-256-cbc:0:izBpxujqC1YbzpCB3qAzgg==:ZqHnitT1pL4YJqKqFES2KEevZYSy2LtlibW5+IMi4XKOGKGy6sE638BXyBbLQQsBtTSrt+JyzwOayKtwIfRbaQsBridx/O1JwBSai1TkGkOsYMBXnlu2Bu/EquCBj5QpjYh7p3Uq4rpiop1KQlin1BJMwnAa1PovhxjpxnYhlhkM4X5ALoGi3XM0bapN48vt';
|
||||
$fromHash = $this->passwordFactory->newFromCiphertext( $hash );
|
||||
$this->assertTrue( $fromHash->update() );
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class LayeredParameterizedPasswordTest extends PasswordTestCase {
|
|||
}
|
||||
|
||||
public static function providePasswordTests() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
true,
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ class VersionCheckerTest extends MediaWikiUnitTestCase {
|
|||
[
|
||||
'incompatible' => 'FakeExtension',
|
||||
'type' => 'incompatible-extensions',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'msg' => 'FakeExtension is not compatible with the current installed version of FakeDependency (1.0.0), it requires: 2.0.0.',
|
||||
],
|
||||
],
|
||||
|
|
@ -214,7 +213,6 @@ class VersionCheckerTest extends MediaWikiUnitTestCase {
|
|||
[
|
||||
'missing' => 'phpMissingExtension',
|
||||
'type' => 'missing-phpExtension',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'msg' => 'FakeExtension requires phpMissingExtension PHP extension to be installed.',
|
||||
],
|
||||
],
|
||||
|
|
@ -275,7 +273,6 @@ class VersionCheckerTest extends MediaWikiUnitTestCase {
|
|||
[
|
||||
'missing' => 'missingAbilityWithMessage',
|
||||
'type' => 'missing-ability',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'msg' => 'FakeExtension requires "missingAbilityWithMessage" ability: Missing.',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ class VueComponentParserTest extends PHPUnit\Framework\TestCase {
|
|||
}
|
||||
|
||||
public static function provideTestParse() {
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
return [
|
||||
[
|
||||
'<template><p>{{foo}}</p></template><script>bar</script><style>baz</style>',
|
||||
|
|
|
|||
|
|
@ -206,7 +206,6 @@ class RemexDriverTest extends MediaWikiUnitTestCase {
|
|||
'a<small><i><div>d</div></i>e</small>',
|
||||
'<p>a</p><small><i><div>d</div></i></small><p><small>e</small></p>'
|
||||
],
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
[
|
||||
'Complex pwrap test 6',
|
||||
'<i>a<div>b</div>c<b>d<div>e</div>f</b>g</i>',
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ class UserTimeCorrectionTest extends MediaWikiUnitTestCase {
|
|||
public function provideDSTVariations() {
|
||||
// Amsterdam observes DST. Johannesburg does not
|
||||
return [
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
[ new DateTime( '2020-12-01' ), 'ZoneInfo|60|Europe/Amsterdam', 'ZoneInfo|60|Europe/Amsterdam', true ],
|
||||
[ new DateTime( '2020-12-01' ), 'ZoneInfo|120|Europe/Amsterdam', 'ZoneInfo|60|Europe/Amsterdam', true ],
|
||||
[ new DateTime( '2020-12-01' ), 'ZoneInfo|120|Africa/Johannesburg', 'ZoneInfo|120|Africa/Johannesburg', true ],
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ class MWCryptHashTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
$data = 'foobar';
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
|
||||
|
||||
$this->assertEquals(
|
||||
|
|
@ -44,7 +43,6 @@ class MWCryptHashTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$data = 'foobar';
|
||||
$key = 'secret';
|
||||
// phpcs:ignore Generic.Files.LineLength
|
||||
$hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
|
||||
|
||||
$this->assertEquals(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
// These modules are only registered when $wgEnableJavaScriptTest is true
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
|
||||
return [
|
||||
|
||||
'sinonjs' => [
|
||||
|
|
|
|||
Loading…
Reference in a new issue