Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/242484
Change subject: Make lines short to pass phpcs in 3 files under tests/phpunit/includes/ ...................................................................... Make lines short to pass phpcs in 3 files under tests/phpunit/includes/ Bug: T102614 Change-Id: I8f3d570fb6e9866d4376f42d4efa05f9c5e7f14d --- M tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php M tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php M tests/phpunit/includes/utils/BatchRowUpdateTest.php 3 files changed, 42 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/84/242484/1 diff --git a/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php index 44242ed..b0df616 100644 --- a/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php @@ -34,7 +34,10 @@ public function testSchemaNotAvailable() { $formatter = new AvroFormatter( array() ); - $this->setExpectedException( 'PHPUnit_Framework_Error_Notice', "The schema for channel 'marty' is not available" ); + $this->setExpectedException( + 'PHPUnit_Framework_Error_Notice', + "The schema for channel 'marty' is not available" + ); $formatter->format( array( 'channel' => 'marty' ) ); } diff --git a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php index 3f08fd2..c839bc4 100644 --- a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php +++ b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php @@ -48,10 +48,16 @@ 'backend' => $backend ) ) ); - $repoMock->expects( $this->any() )->method( 'getMasterDB' )->will( $this->returnValue( $dbMock ) ); + $repoMock + ->expects( $this->any() ) + ->method( 'getMasterDB' ) + ->will( $this->returnValue( $dbMock ) ); $this->migratorMock = $this->getMock( 'MigrateFileRepoLayout', array( 'getRepo' ) ); - $this->migratorMock->expects( $this->any() )->method( 'getRepo' )->will( $this->returnValue( $repoMock ) ); + $this->migratorMock + ->expects( $this->any() ) + ->method( 'getRepo' ) + ->will( $this->returnValue( $repoMock ) ); $this->tmpFilepath = TempFSFile::factory( 'migratefilelayout-test-', 'png' )->getPath(); @@ -59,7 +65,12 @@ $hashPath = $repoMock->getHashPath( $filename ); - $status = $repoMock->store( $this->tmpFilepath, 'public', $hashPath . $filename, FileRepo::OVERWRITE ); + $status = $repoMock->store( + $this->tmpFilepath, + 'public', + $hashPath . $filename, + FileRepo::OVERWRITE + ); } protected function deleteFilesRecursively( $directory ) { @@ -85,7 +96,10 @@ } public function testMigration() { - $this->migratorMock->loadParamsAndArgs( null, array( 'oldlayout' => 'name', 'newlayout' => 'sha1' ) ); + $this->migratorMock->loadParamsAndArgs( + null, + array( 'oldlayout' => 'name', 'newlayout' => 'sha1' ) + ); ob_start(); @@ -105,10 +119,18 @@ . '/' . $sha1; - $this->assertEquals( file_get_contents( $expectedOriginalFilepath ), $this->text, 'New sha1 file should be exist and have the right contents' ); + $this->assertEquals( + file_get_contents( $expectedOriginalFilepath ), + $this->text, + 'New sha1 file should be exist and have the right contents' + ); $expectedPublicFilepath = $this->tmpPrefix . '-public/f/f8/Foo.png'; - $this->assertEquals( file_get_contents( $expectedPublicFilepath ), $this->text, 'Existing name file should still and have the right contents' ); + $this->assertEquals( + file_get_contents( $expectedPublicFilepath ), + $this->text, + 'Existing name file should still and have the right contents' + ); } } diff --git a/tests/phpunit/includes/utils/BatchRowUpdateTest.php b/tests/phpunit/includes/utils/BatchRowUpdateTest.php index 4684658..082ac82 100644 --- a/tests/phpunit/includes/utils/BatchRowUpdateTest.php +++ b/tests/phpunit/includes/utils/BatchRowUpdateTest.php @@ -123,11 +123,14 @@ /** * @dataProvider provider_readerSetFetchColumns */ - public function testReaderSetFetchColumns( $message, array $columns, array $primaryKeys, array $fetchColumns ) { + public function testReaderSetFetchColumns( + $message, array $columns, array $primaryKeys, array $fetchColumns + ) { $db = $this->mockDb(); $db->expects( $this->once() ) ->method( 'select' ) - ->with( 'some_table', $columns ) // only testing second parameter of DatabaseBase::select + // only testing second parameter of DatabaseBase::select + ->with( 'some_table', $columns ) ->will( $this->returnValue( new ArrayIterator( array() ) ) ); $reader = new BatchRowIterator( $db, 'some_table', $primaryKeys, 22 ); @@ -148,7 +151,8 @@ ), array( - 'With multiple primary keys the first conditions must use >= and the final condition must use >', + 'With multiple primary keys the first conditions ' . + 'must use >= and the final condition must use >', // Expected second iteration array( "( id_field = '3' AND foo > '103' ) OR ( id_field > '3' )" ), // Primary key(s) @@ -164,7 +168,9 @@ * * @dataProvider provider_readerSelectConditions */ - public function testReaderSelectConditionsMultiplePrimaryKeys( $message, $expectedSecondIteration, $primaryKeys, $batchSize = 3 ) { + public function testReaderSelectConditionsMultiplePrimaryKeys( + $message, $expectedSecondIteration, $primaryKeys, $batchSize = 3 + ) { $results = $this->genSelectResult( $batchSize, $batchSize * 3, function() { static $i = 0, $j = 100, $k = 1000; return array( 'id_field' => ++$i, 'foo' => ++$j, 'bar' => ++$k ); -- To view, visit https://gerrit.wikimedia.org/r/242484 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f3d570fb6e9866d4376f42d4efa05f9c5e7f14d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits