diff options
author | Timo Tijhof <krinkle@fastmail.com> | 2022-02-16 17:43:43 +0000 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2022-02-18 18:32:05 +0000 |
commit | 8d406bbcd69cb50b110bd3fb0d0c9878e3b0b3be (patch) | |
tree | 562870515abca9923702fbd4ff394a69d0c19667 /tests/phpunit/includes/api | |
parent | 38467129b8c14acded3c3a5528c51e8f4641f25f (diff) | |
download | mediawikicore-8d406bbcd69cb50b110bd3fb0d0c9878e3b0b3be.tar.gz mediawikicore-8d406bbcd69cb50b110bd3fb0d0c9878e3b0b3be.zip |
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
Diffstat (limited to 'tests/phpunit/includes/api')
6 files changed, 0 insertions, 12 deletions
diff --git a/tests/phpunit/includes/api/ApiComparePagesTest.php b/tests/phpunit/includes/api/ApiComparePagesTest.php index 12663bad45f8..f2db3b2f3cd8 100644 --- a/tests/phpunit/includes/api/ApiComparePagesTest.php +++ b/tests/phpunit/includes/api/ApiComparePagesTest.php @@ -186,7 +186,6 @@ class ApiComparePagesTest extends ApiTestCase { } public static function provideDiff() { - // phpcs:disable Generic.Files.LineLength.TooLong return [ 'Basic diff, titles' => [ [ diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index 0c9d09f544b2..57447abbd0f0 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -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(), diff --git a/tests/phpunit/includes/api/Validator/SubmoduleDefTest.php b/tests/phpunit/includes/api/Validator/SubmoduleDefTest.php index da111529f224..6f97a93cf256 100644 --- a/tests/phpunit/includes/api/Validator/SubmoduleDefTest.php +++ b/tests/phpunit/includes/api/Validator/SubmoduleDefTest.php @@ -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, ], diff --git a/tests/phpunit/includes/api/format/ApiFormatBaseTest.php b/tests/phpunit/includes/api/format/ApiFormatBaseTest.php index ccfc8841526b..22c584202760 100644 --- a/tests/phpunit/includes/api/format/ApiFormatBaseTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatBaseTest.php @@ -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)' ], ]; diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php index 66e620e89a6c..de3a9d4d553a 100644 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php @@ -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 diff --git a/tests/phpunit/includes/api/format/ApiFormatXmlTest.php b/tests/phpunit/includes/api/format/ApiFormatXmlTest.php index 2f9195b17c89..02578e5cee14 100644 --- a/tests/phpunit/includes/api/format/ApiFormatXmlTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatXmlTest.php @@ -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>' ], |