aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api
diff options
context:
space:
mode:
authorTimo Tijhof <krinkle@fastmail.com>2022-02-16 17:43:43 +0000
committerKrinkle <krinkle@fastmail.com>2022-02-18 18:32:05 +0000
commit8d406bbcd69cb50b110bd3fb0d0c9878e3b0b3be (patch)
tree562870515abca9923702fbd4ff394a69d0c19667 /tests/phpunit/includes/api
parent38467129b8c14acded3c3a5528c51e8f4641f25f (diff)
downloadmediawikicore-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')
-rw-r--r--tests/phpunit/includes/api/ApiComparePagesTest.php1
-rw-r--r--tests/phpunit/includes/api/ApiMainTest.php2
-rw-r--r--tests/phpunit/includes/api/Validator/SubmoduleDefTest.php2
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatBaseTest.php4
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatPhpTest.php1
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatXmlTest.php2
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 &lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; " .
"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 &lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; " .
"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|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;mod1&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+mod2|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;mod2&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+recurse|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;recurse&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+dep|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot; class=&quot;apihelp-deprecated-value&quot;&gt;dep&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+int|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot; class=&quot;apihelp-internal-value&quot;&gt;int&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+depint|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot; class=&quot;apihelp-deprecated-value apihelp-internal-value&quot;&gt;depint&lt;/span&gt;]]</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|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;mod3&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+mod4|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;mod4&lt;/span&gt;]]</text><text>[[Special:ApiHelp/testmod+dep|&lt;span dir=&quot;ltr&quot; lang=&quot;en&quot; class=&quot;apihelp-deprecated-value&quot;&gt;xyz&lt;/span&gt;]]</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: &lt;b>ok&lt;/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: &lt;b>ok&lt;/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: &lt;b>ok&lt;/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&amp;b=2&amp;format=mock">http://example.org/wx/api.php?a=1&amp;b=2&amp;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>' ],