From dc71f6cf02dcd5cc467382c5b72861d7b75aa764 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Wed, 30 Sep 2015 09:15:48 +0300 Subject: [PATCH] Make lines short to pass phpcs in media tests PHP files Some lines that weren't too long are also broken up for consistency and readability. Bug: T102614 Change-Id: I36e3225e135b58bc22705afbb888b06f93b5a9a8 --- .../phpunit/includes/media/ExifBitmapTest.php | 30 ++++++++++--- .../includes/media/FormatMetadataTest.php | 44 +++++++++++++++---- 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php index adbc97757c..078c842b8e 100644 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ b/tests/phpunit/includes/media/ExifBitmapTest.php @@ -148,7 +148,9 @@ class ExifBitmapTest extends MediaWikiMediaTestCase { * @dataProvider provideSwappingICCProfile * @covers BitmapHandler::swapICCProfile */ - public function testSwappingICCProfile( $sourceFilename, $controlFilename, $newProfileFilename, $oldProfileName ) { + public function testSwappingICCProfile( + $sourceFilename, $controlFilename, $newProfileFilename, $oldProfileName + ) { global $wgExiftool; if ( !$wgExiftool || !is_file( $wgExiftool ) ) { @@ -167,17 +169,35 @@ class ExifBitmapTest extends MediaWikiMediaTestCase { $file = $this->dataFile( $sourceFilename, 'image/jpeg' ); $this->handler->swapICCProfile( $filepath, $oldProfileName, $profileFilepath ); - $this->assertEquals( sha1( file_get_contents( $filepath ) ), sha1( file_get_contents( $controlFilepath ) ) ); + $this->assertEquals( + sha1( file_get_contents( $filepath ) ), + sha1( file_get_contents( $controlFilepath ) ) + ); } public function provideSwappingICCProfile() { return array( // File with sRGB should end up with TinyRGB - array( 'srgb.jpg', 'tinyrgb.jpg', 'tinyrgb.icc', 'IEC 61966-2.1 Default RGB colour space - sRGB' ), + array( + 'srgb.jpg', + 'tinyrgb.jpg', + 'tinyrgb.icc', + 'IEC 61966-2.1 Default RGB colour space - sRGB' + ), // File with TinyRGB should be left unchanged - array( 'tinyrgb.jpg', 'tinyrgb.jpg', 'tinyrgb.icc', 'IEC 61966-2.1 Default RGB colour space - sRGB' ), + array( + 'tinyrgb.jpg', + 'tinyrgb.jpg', + 'tinyrgb.icc', + 'IEC 61966-2.1 Default RGB colour space - sRGB' + ), // File with no profile should be left unchanged - array( 'test.jpg', 'test.jpg', 'tinyrgb.icc', 'IEC 61966-2.1 Default RGB colour space - sRGB' ) + array( + 'test.jpg', + 'test.jpg', + 'tinyrgb.icc', + 'IEC 61966-2.1 Default RGB colour space - sRGB' + ) ); } } diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php b/tests/phpunit/includes/media/FormatMetadataTest.php index b666c83c01..22383e11a8 100644 --- a/tests/phpunit/includes/media/FormatMetadataTest.php +++ b/tests/phpunit/includes/media/FormatMetadataTest.php @@ -53,17 +53,45 @@ class FormatMetadataTest extends MediaWikiMediaTestCase { public function provideResolveMultivalueValue() { return array( - 'nonArray' => array( 'foo', 'foo' ), - 'multiValue' => array( array( 'first', 'second', 'third', '_type' => 'ol' ), 'first' ), - 'noType' => array( array( 'first', 'second', 'third' ), 'first' ), - 'typeFirst' => array( array( '_type' => 'ol', 'first', 'second', 'third' ), 'first' ), + 'nonArray' => array( + 'foo', + 'foo' + ), + 'multiValue' => array( + array( 'first', 'second', 'third', '_type' => 'ol' ), + 'first' + ), + 'noType' => array( + array( 'first', 'second', 'third' ), + 'first' + ), + 'typeFirst' => array( + array( '_type' => 'ol', 'first', 'second', 'third' ), + 'first' + ), 'multilang' => array( - array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ), - array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ), + array( + 'en' => 'first', + 'de' => 'Erste', + '_type' => 'lang' + ), + array( + 'en' => 'first', + 'de' => 'Erste', + '_type' => 'lang' + ), ), 'multilang-multivalue' => array( - array( 'en' => array( 'first', 'second' ), 'de' => array( 'Erste', 'Zweite' ), '_type' => 'lang' ), - array( 'en' => 'first', 'de' => 'Erste', '_type' => 'lang' ), + array( + 'en' => array( 'first', 'second' ), + 'de' => array( 'Erste', 'Zweite' ), + '_type' => 'lang' + ), + array( + 'en' => 'first', + 'de' => 'Erste', + '_type' => 'lang' + ), ), ); } -- 2.20.1