From: umherirrender Date: Fri, 18 Jul 2014 22:56:35 +0000 (+0200) Subject: Reformat function chains in FileTest.php X-Git-Tag: 1.31.0-rc.0~14845^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=3ea699368ffe100dadb7ccf4db1d15601114ef38;p=lhc%2Fweb%2Fwiklou.git Reformat function chains in FileTest.php This makes the mock code more readable. Also break a long line phpcs mentioned. Change-Id: I6de5f05e5ab3fb18bd15518409334d39beba71cb --- diff --git a/tests/phpunit/includes/filerepo/file/FileTest.php b/tests/phpunit/includes/filerepo/file/FileTest.php index 9af35fbe2a..ffa9876625 100644 --- a/tests/phpunit/includes/filerepo/file/FileTest.php +++ b/tests/phpunit/includes/filerepo/file/FileTest.php @@ -42,8 +42,9 @@ class FileTest extends MediaWikiMediaTestCase { ->setMethods( array( 'getWidth' ) ) ->getMockForAbstractClass(); - $fileMock->expects( $this->any() )->method( 'getWidth' )->will( - $this->returnValue( $data['width'] ) ); + $fileMock->expects( $this->any() ) + ->method( 'getWidth' ) + ->will( $this->returnValue( $data['width'] ) ); $this->assertEquals( $data['expectedBucket'], @@ -146,29 +147,35 @@ class FileTest extends MediaWikiMediaTestCase { $fsFile = new FSFile( 'fsFilePath' ); - $repoMock->expects( $this->any() )->method( 'fileExists' )->will( - $this->returnValue( true ) ); + $repoMock->expects( $this->any() ) + ->method( 'fileExists' ) + ->will( $this->returnValue( true ) ); - $repoMock->expects( $this->any() )->method( 'getLocalReference' )->will( - $this->returnValue( $fsFile ) ); + $repoMock->expects( $this->any() ) + ->method( 'getLocalReference' ) + ->will( $this->returnValue( $fsFile ) ); $handlerMock = $this->getMock( 'BitmapHandler', array( 'supportsBucketing' ) ); - $handlerMock->expects( $this->any() )->method( 'supportsBucketing' )->will( - $this->returnValue( $data['supportsBucketing'] ) ); + $handlerMock->expects( $this->any() ) + ->method( 'supportsBucketing' ) + ->will( $this->returnValue( $data['supportsBucketing'] ) ); $fileMock = $this->getMockBuilder( 'File' ) ->setConstructorArgs( array( 'fileMock', $repoMock ) ) ->setMethods( array( 'getThumbnailBucket', 'getLocalRefPath', 'getHandler' ) ) ->getMockForAbstractClass(); - $fileMock->expects( $this->any() )->method( 'getThumbnailBucket' )->will( - $this->returnValue( $data['thumbnailBucket'] ) ); + $fileMock->expects( $this->any() ) + ->method( 'getThumbnailBucket' ) + ->will( $this->returnValue( $data['thumbnailBucket'] ) ); - $fileMock->expects( $this->any() )->method( 'getLocalRefPath' )->will( - $this->returnValue( 'localRefPath' ) ); + $fileMock->expects( $this->any() ) + ->method( 'getLocalRefPath' ) + ->will( $this->returnValue( 'localRefPath' ) ); - $fileMock->expects( $this->any() )->method( 'getHandler' )->will( - $this->returnValue( $handlerMock ) ); + $fileMock->expects( $this->any() ) + ->method( 'getHandler' ) + ->will( $this->returnValue( $handlerMock ) ); $reflection = new ReflectionClass( $fileMock ); $reflection_property = $reflection->getProperty( 'handler' ); @@ -250,15 +257,18 @@ class FileTest extends MediaWikiMediaTestCase { $fileMock = $this->getMockBuilder( 'File' ) ->setConstructorArgs( array( 'fileMock', $repoMock ) ) - ->setMethods( array( 'getWidth', 'getBucketThumbPath', 'makeTransformTmpFile', 'generateAndSaveThumb', 'getHandler' ) ) + ->setMethods( array( 'getWidth', 'getBucketThumbPath', 'makeTransformTmpFile', + 'generateAndSaveThumb', 'getHandler' ) ) ->getMockForAbstractClass(); $handlerMock = $this->getMock( 'JpegHandler', array( 'supportsBucketing' ) ); - $handlerMock->expects( $this->any() )->method( 'supportsBucketing' )->will( - $this->returnValue( true ) ); + $handlerMock->expects( $this->any() ) + ->method( 'supportsBucketing' ) + ->will( $this->returnValue( true ) ); - $fileMock->expects( $this->any() )->method( 'getHandler' )->will( - $this->returnValue( $handlerMock ) ); + $fileMock->expects( $this->any() ) + ->method( 'getHandler' ) + ->will( $this->returnValue( $handlerMock ) ); $reflectionMethod = new ReflectionMethod( 'File', 'generateBucketsIfNeeded' ); $reflectionMethod->setAccessible( true );