From 94068c3e811398b53cd53372a297239f9fd36012 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sat, 3 Oct 2015 16:44:13 +0300 Subject: [PATCH] Fix Generic.Files.LineLength phpcs check under phpunit/includes/api Bug: T102614 Change-Id: Ic0b3d9b58fee8dc20a976ae65dcb7072a3afc3b1 --- .../api/ApiContinuationManagerTest.php | 12 +- .../phpunit/includes/api/ApiEditPageTest.php | 3 +- .../includes/api/ApiErrorFormatterTest.php | 114 ++++++++++++++---- tests/phpunit/includes/api/ApiMainTest.php | 8 +- .../includes/api/ApiModuleManagerTest.php | 26 ++-- tests/phpunit/includes/api/ApiResultTest.php | 20 ++- .../includes/api/ApiRevisionDeleteTest.php | 8 +- .../includes/api/format/ApiFormatDbgTest.php | 61 ++++++++-- .../includes/api/format/ApiFormatJsonTest.php | 29 ++++- .../includes/api/format/ApiFormatNoneTest.php | 9 +- .../includes/api/format/ApiFormatPhpTest.php | 2 + .../includes/api/format/ApiFormatTxtTest.php | 2 + .../includes/api/format/ApiFormatXmlTest.php | 4 + 13 files changed, 241 insertions(+), 57 deletions(-) diff --git a/tests/phpunit/includes/api/ApiContinuationManagerTest.php b/tests/phpunit/includes/api/ApiContinuationManagerTest.php index 2edf0c6fb1..30b679dc56 100644 --- a/tests/phpunit/includes/api/ApiContinuationManagerTest.php +++ b/tests/phpunit/includes/api/ApiContinuationManagerTest.php @@ -168,13 +168,18 @@ class ApiContinuationManagerTest extends MediaWikiTestCase { ); } - $manager = self::getManager( '||mock2', array_slice( $allModules, 0, 2 ), array( 'mock1', 'mock2' ) ); + $manager = self::getManager( + '||mock2', + array_slice( $allModules, 0, 2 ), + array( 'mock1', 'mock2' ) + ); try { $manager->addContinueParam( $allModules[1], 'm2continue', 1 ); $this->fail( 'Expected exception not thrown' ); } catch ( UnexpectedValueException $ex ) { $this->assertSame( - 'Module \'mock2\' was not supposed to have been executed, but it was executed anyway', + 'Module \'mock2\' was not supposed to have been executed, ' . + 'but it was executed anyway', $ex->getMessage(), 'Expected exception' ); @@ -184,7 +189,8 @@ class ApiContinuationManagerTest extends MediaWikiTestCase { $this->fail( 'Expected exception not thrown' ); } catch ( UnexpectedValueException $ex ) { $this->assertSame( - 'Module \'mocklist\' called ApiContinuationManager::addContinueParam but was not passed to ApiContinuationManager::__construct', + 'Module \'mocklist\' called ApiContinuationManager::addContinueParam ' . + 'but was not passed to ApiContinuationManager::__construct', $ex->getMessage(), 'Expected exception' ); diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 6a2428157b..4a90bf8458 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -475,7 +475,8 @@ class ApiEditPageTest extends ApiTestCase { public function testCheckDirectApiEditingDisallowed_forNonTextContent() { $this->setExpectedException( 'UsageException', - 'Direct editing via API is not supported for content model testing used by Dummy:ApiEditPageTest_nonTextPageEdit' + 'Direct editing via API is not supported for content model ' . + 'testing used by Dummy:ApiEditPageTest_nonTextPageEdit' ); $this->doApiRequestWithToken( array( diff --git a/tests/phpunit/includes/api/ApiErrorFormatterTest.php b/tests/phpunit/includes/api/ApiErrorFormatterTest.php index 8ebdf60f5f..3e5f3555c6 100644 --- a/tests/phpunit/includes/api/ApiErrorFormatterTest.php +++ b/tests/phpunit/includes/api/ApiErrorFormatterTest.php @@ -130,13 +130,21 @@ class ApiErrorFormatterTest extends MediaWikiTestCase { array( 'errors' => array( 'err' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), $I => 'error', ), ), 'warnings' => array( 'string' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), $I => 'warning', ), ), @@ -144,24 +152,44 @@ class ApiErrorFormatterTest extends MediaWikiTestCase { array( 'errors' => array( 'errWithData' => array( - array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ), - 'overriddenData' => true ), + array( + 'code' => 'overriddenCode', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ), + 'overriddenData' => true + ), $I => 'error', ), ), 'warnings' => array( 'messageWithData' => array( - array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ), - 'overriddenData' => true ), + array( + 'code' => 'overriddenCode', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ), + 'overriddenData' => true + ), $I => 'warning', ), 'message' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), $I => 'warning', ), 'foo' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), - array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), + array( + 'code' => 'parentheses', + 'message' => 'parentheses', + 'params' => array( 'foobar', $I => 'param' ) + ), $I => 'warning', ), ), @@ -169,17 +197,37 @@ class ApiErrorFormatterTest extends MediaWikiTestCase { array( 'errors' => array( 'status' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), - array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), + array( + 'code' => 'parentheses', + 'message' => 'parentheses', + 'params' => array( 'foobar', $I => 'param' ) + ), $I => 'error', ), ), 'warnings' => array( 'status' => array( - array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), - array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ), - array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ), - 'overriddenData' => true ), + array( + 'code' => 'mainpage', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), + array( + 'code' => 'parentheses', + 'message' => 'parentheses', + 'params' => array( 'foobar', $I => 'param' ) + ), + array( + 'code' => 'overriddenCode', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ), + 'overriddenData' => true + ), $I => 'warning', ), ), @@ -328,8 +376,16 @@ class ApiErrorFormatterTest extends MediaWikiTestCase { $I = ApiResult::META_INDEXED_TAG_NAME; $this->assertSame( array( - array( 'type' => 'error', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), - array( 'type' => 'error', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ), + array( + 'type' => 'error', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), + array( + 'type' => 'error', + 'message' => 'parentheses', + 'params' => array( 'foobar', $I => 'param' ) + ), $I => 'error', ), $formatter->arrayFromStatus( $status, 'error' ), @@ -337,10 +393,26 @@ class ApiErrorFormatterTest extends MediaWikiTestCase { ); $this->assertSame( array( - array( 'type' => 'warning', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ), - array( 'type' => 'warning', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ), - array( 'message' => 'mainpage', 'params' => array( $I => 'param' ), 'type' => 'warning' ), - array( 'message' => 'mainpage', 'params' => array( $I => 'param' ), 'type' => 'warning' ), + array( + 'type' => 'warning', + 'message' => 'mainpage', + 'params' => array( $I => 'param' ) + ), + array( + 'type' => 'warning', + 'message' => 'parentheses', + 'params' => array( 'foobar', $I => 'param' ) + ), + array( + 'message' => 'mainpage', + 'params' => array( $I => 'param' ), + 'type' => 'warning' + ), + array( + 'message' => 'mainpage', + 'params' => array( $I => 'param' ), + 'type' => 'warning' + ), $I => 'warning', ), $formatter->arrayFromStatus( $status, 'warning' ), diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index 94b741dcac..aef48158a0 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -90,7 +90,9 @@ class ApiMainTest extends ApiTestCase { * @param int $status Expected response status * @param bool $post Request is a POST */ - public function testCheckConditionalRequestHeaders( $headers, $conditions, $status, $post = false ) { + public function testCheckConditionalRequestHeaders( + $headers, $conditions, $status, $post = false + ) { $request = new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ), $post ); $request->setHeaders( $headers ); $request->response()->statusHeader( 200 ); // Why doesn't it default? @@ -186,7 +188,9 @@ class ApiMainTest extends ApiTestCase { * @param bool $isError $isError flag * @param bool $post Request is a POST */ - public function testConditionalRequestHeadersOutput( $conditions, $headers, $isError = false, $post = false ) { + public function testConditionalRequestHeadersOutput( + $conditions, $headers, $isError = false, $post = false + ) { $request = new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ), $post ); $response = $request->response(); diff --git a/tests/phpunit/includes/api/ApiModuleManagerTest.php b/tests/phpunit/includes/api/ApiModuleManagerTest.php index dab81e162a..5e74f13d3f 100644 --- a/tests/phpunit/includes/api/ApiModuleManagerTest.php +++ b/tests/phpunit/includes/api/ApiModuleManagerTest.php @@ -307,12 +307,24 @@ class ApiModuleManagerTest extends MediaWikiTestCase { $moduleManager->addModules( $fooModules, 'foo' ); $moduleManager->addModules( $barModules, 'bar' ); - $this->assertEquals( 'ApiLogin', $moduleManager->getClassName( 'login' ) ); - $this->assertEquals( 'ApiLogout', $moduleManager->getClassName( 'logout' ) ); - $this->assertEquals( 'ApiFeedContributions', $moduleManager->getClassName( 'feedcontributions' ) ); - $this->assertEquals( 'ApiFeedRecentChanges', $moduleManager->getClassName( 'feedrecentchanges' ) ); - $this->assertFalse( $moduleManager->getClassName( 'nonexistentmodule' ) ); + $this->assertEquals( + 'ApiLogin', + $moduleManager->getClassName( 'login' ) + ); + $this->assertEquals( + 'ApiLogout', + $moduleManager->getClassName( 'logout' ) + ); + $this->assertEquals( + 'ApiFeedContributions', + $moduleManager->getClassName( 'feedcontributions' ) + ); + $this->assertEquals( + 'ApiFeedRecentChanges', + $moduleManager->getClassName( 'feedrecentchanges' ) + ); + $this->assertFalse( + $moduleManager->getClassName( 'nonexistentmodule' ) + ); } - - } diff --git a/tests/phpunit/includes/api/ApiResultTest.php b/tests/phpunit/includes/api/ApiResultTest.php index 2f31677e70..d43db71421 100644 --- a/tests/phpunit/includes/api/ApiResultTest.php +++ b/tests/phpunit/includes/api/ApiResultTest.php @@ -973,7 +973,12 @@ class ApiResultTest extends MediaWikiTestCase { 'kvpmerge' => array( $kvp( 'name', 'x', 'value', 'a' ), $kvp( 'name', 'y', 'value', array( 'b', ApiResult::META_TYPE => 'array' ) ), - array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ), + array( + 'name' => 'z', + 'c' => 'd', + ApiResult::META_TYPE => 'assoc', + ApiResult::META_PRESERVE_KEYS => array( 'name' ) + ), ApiResult::META_TYPE => 'array', ApiResult::META_KVP_MERGE => true, ), @@ -1011,7 +1016,11 @@ class ApiResultTest extends MediaWikiTestCase { 'kvpmerge' => array( $kvp( 'name', 'x', '*', 'a' ), $kvp( 'name', 'y', '*', array( 'b', ApiResult::META_TYPE => 'array' ) ), - array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ), + array( + 'name' => 'z', + 'c' => 'd', + ApiResult::META_TYPE => 'assoc', + ApiResult::META_PRESERVE_KEYS => array( 'name' ) ), ApiResult::META_TYPE => 'array', ApiResult::META_KVP_MERGE => true, ), @@ -1053,7 +1062,12 @@ class ApiResultTest extends MediaWikiTestCase { 'kvpmerge' => array( (object)$kvp( 'name', 'x', 'value', 'a' ), (object)$kvp( 'name', 'y', 'value', array( 'b', ApiResult::META_TYPE => 'array' ) ), - (object)array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ), + (object)array( + 'name' => 'z', + 'c' => 'd', + ApiResult::META_TYPE => 'assoc', + ApiResult::META_PRESERVE_KEYS => array( 'name' ) + ), ApiResult::META_TYPE => 'array', ApiResult::META_KVP_MERGE => true, ), diff --git a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php index 362d647f86..575859b506 100644 --- a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php +++ b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php @@ -14,12 +14,16 @@ class ApiRevisionDeleteTest extends ApiTestCase { protected function setUp() { // Needs to be before setup since this gets cached - $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', array( 'sysop' => array( 'deleterevision' => true ) ) ); + $this->mergeMwGlobalArrayValue( + 'wgGroupPermissions', + array( 'sysop' => array( 'deleterevision' => true ) ) + ); parent::setUp(); // Make a few edits for us to play with for ( $i = 1; $i <= 5; $i++ ) { self::editPage( self::$page, MWCryptRand::generateHex( 10 ), 'summary' ); - $this->revs[] = Title::newFromText( self::$page )->getLatestRevID( Title::GAID_FOR_UPDATE ); + $this->revs[] = Title::newFromText( self::$page ) + ->getLatestRevID( Title::GAID_FOR_UPDATE ); } } diff --git a/tests/phpunit/includes/api/format/ApiFormatDbgTest.php b/tests/phpunit/includes/api/format/ApiFormatDbgTest.php index 3fcfc73fc6..addd16a6b2 100644 --- a/tests/phpunit/includes/api/format/ApiFormatDbgTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatDbgTest.php @@ -29,18 +29,55 @@ class ApiFormatDbgTest extends ApiFormatTestBase { array( array( 'fóo' ), "array ({$warning}\n 0 => 'fóo',\n)" ), // Arrays and objects - array( array( array() ), "array ({$warning}\n 0 => \n array (\n ),\n)" ), - array( array( array( 1 ) ), "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" ), - array( array( array( 'x' => 1 ) ), "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" ), - array( array( array( 2 => 1 ) ), "array ({$warning}\n 0 => \n array (\n 2 => 1,\n ),\n)" ), - array( array( (object)array() ), "array ({$warning}\n 0 => \n array (\n ),\n)" ), - array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), - "array ({$warning}\n 0 => \n array (\n 0 => \n array (\n 'key' => 'x',\n '*' => 1,\n ),\n ),\n)" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" ), - array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "array ({$warning}\n 0 => \n array (\n 0 => 'a',\n 1 => 'b',\n ),\n)" ), + array( + array( array() ), + "array ({$warning}\n 0 => \n array (\n ),\n)" + ), + array( + array( array( 1 ) ), + "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" + ), + array( + array( array( 'x' => 1 ) ), + "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" + ), + array( + array( array( 2 => 1 ) ), + "array ({$warning}\n 0 => \n array (\n 2 => 1,\n ),\n)" + ), + array( + array( (object)array() ), + "array ({$warning}\n 0 => \n array (\n ),\n)" + ), + array( + array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), + "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" + ), + array( + array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), + "array ({$warning}\n 0 => \n array (\n 0 => 1,\n ),\n)" + ), + array( + array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), + "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" + ), + array( + array( array( + 'x' => 1, + ApiResult::META_TYPE => 'BCkvp', + ApiResult::META_KVP_KEY_NAME => 'key' + ) ), + "array ({$warning}\n 0 => \n array (\n 0 => \n " . + "array (\n 'key' => 'x',\n '*' => 1,\n ),\n ),\n)" + ), + array( + array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), + "array ({$warning}\n 0 => \n array (\n 'x' => 1,\n ),\n)" + ), + array( + array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), + "array ({$warning}\n 0 => \n array (\n 0 => 'a',\n 1 => 'b',\n ),\n)" + ), // Content array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ), diff --git a/tests/phpunit/includes/api/format/ApiFormatJsonTest.php b/tests/phpunit/includes/api/format/ApiFormatJsonTest.php index 3dfcaf0fd7..f7ffcb9755 100644 --- a/tests/phpunit/includes/api/format/ApiFormatJsonTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatJsonTest.php @@ -44,8 +44,14 @@ class ApiFormatJsonTest extends ApiFormatTestBase { array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '[{"0":1}]' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '[[1]]' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '[{"x":1}]' ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), - '[[{"key":"x","*":1}]]' ), + array( + array( array( + 'x' => 1, + ApiResult::META_TYPE => 'BCkvp', + ApiResult::META_KVP_KEY_NAME => 'key' + ) ), + '[[{"key":"x","*":1}]]' + ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '[{"x":1}]' ), array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '[["a","b"]]' ), @@ -85,10 +91,23 @@ class ApiFormatJsonTest extends ApiFormatTestBase { array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '[{"0":1}]' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '[[1]]' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '[{"x":1}]' ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), - '[{"x":1}]' ), + array( + array( array( + 'x' => 1, + ApiResult::META_TYPE => 'BCkvp', + ApiResult::META_KVP_KEY_NAME => 'key' + ) ), + '[{"x":1}]' + ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '[[1]]' ), - array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '[{"0":"a","1":"b"}]' ), + array( + array( array( + 'a', + 'b', + ApiResult::META_TYPE => 'BCassoc' + ) ), + '[{"0":"a","1":"b"}]' + ), // Content array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ), diff --git a/tests/phpunit/includes/api/format/ApiFormatNoneTest.php b/tests/phpunit/includes/api/format/ApiFormatNoneTest.php index 8f81a411e4..c0192bc3fb 100644 --- a/tests/phpunit/includes/api/format/ApiFormatNoneTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatNoneTest.php @@ -29,7 +29,14 @@ class ApiFormatNoneTest extends ApiFormatTestBase { array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '' ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '' ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), '' ), + array( + array( array( + 'x' => 1, + ApiResult::META_TYPE => 'BCkvp', + ApiResult::META_KVP_KEY_NAME => 'key' + ) ), + '' + ), array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '' ), array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '' ), diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php index 09c7c0ce59..745686f521 100644 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php @@ -20,6 +20,7 @@ class ApiFormatPhpTest extends ApiFormatTestBase { } public static function provideGeneralEncoding() { + // @codingStandardsIgnoreStart Generic.Files.LineLength return array_merge( self::addFormatVersion( 1, array( // Basic types @@ -96,6 +97,7 @@ class ApiFormatPhpTest extends ApiFormatTestBase { 'a:1:{s:3:"foo";s:3:"foo";}' ), ) ) ); + // @codingStandardsIgnoreEnd } public function testCrossDomainMangling() { diff --git a/tests/phpunit/includes/api/format/ApiFormatTxtTest.php b/tests/phpunit/includes/api/format/ApiFormatTxtTest.php index b0a2a9602a..1576c1dbb4 100644 --- a/tests/phpunit/includes/api/format/ApiFormatTxtTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatTxtTest.php @@ -29,6 +29,7 @@ class ApiFormatTxtTest extends ApiFormatTestBase { array( array( 'fóo' ), "Array\n({$warning}\n [0] => fóo\n)\n" ), // Arrays and objects + // @codingStandardsIgnoreStart Generic.Files.LineLength array( array( array() ), "Array\n({$warning}\n [0] => Array\n (\n )\n\n)\n" ), array( array( array( 1 ) ), "Array\n({$warning}\n [0] => Array\n (\n [0] => 1\n )\n\n)\n" ), array( array( array( 'x' => 1 ) ), "Array\n({$warning}\n [0] => Array\n (\n [x] => 1\n )\n\n)\n" ), @@ -49,6 +50,7 @@ class ApiFormatTxtTest extends ApiFormatTestBase { // BC Subelements array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ), "Array\n({$warning}\n [foo] => Array\n (\n [*] => foo\n )\n\n)\n" ), + // @codingStandardsIgnoreEnd ); } diff --git a/tests/phpunit/includes/api/format/ApiFormatXmlTest.php b/tests/phpunit/includes/api/format/ApiFormatXmlTest.php index 7babaedb9b..0b7ae35a5d 100644 --- a/tests/phpunit/includes/api/format/ApiFormatXmlTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatXmlTest.php @@ -12,9 +12,11 @@ class ApiFormatXmlTest extends ApiFormatTestBase { public static function setUpBeforeClass() { parent::setUpBeforeClass(); $page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest.xsl' ) ); + // @codingStandardsIgnoreStart Generic.Files.LineLength $page->doEditContent( new WikitextContent( '' ), 'Summary' ); + // @codingStandardsIgnoreEnd $page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest' ) ); $page->doEditContent( new WikitextContent( 'Bogus' ), 'Summary' ); $page = WikiPage::factory( Title::newFromText( 'ApiFormatXmlTest' ) ); @@ -22,6 +24,7 @@ class ApiFormatXmlTest extends ApiFormatTestBase { } public static function provideGeneralEncoding() { + // @codingStandardsIgnoreStart Generic.Files.LineLength return array( // Basic types array( array( null, 'a' => null ), '<_v _idx="0" />' ), @@ -114,6 +117,7 @@ class ApiFormatXmlTest extends ApiFormatTestBase { '" type="text/xsl" ?>', array( 'xslt' => 'MediaWiki:ApiFormatXmlTest.xsl' ) ), ); + // @codingStandardsIgnoreEnd } } -- 2.20.1