X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Futils%2FBatchRowUpdateTest.php;h=d80a61c4fbfcb3922bc6a9af1e4668fcedfa0bf4;hp=6506d58e21df0896830bed3d7e62f93fb458358e;hb=e1817d72ba4c2b08fee51ca3dade1d5dafc16122;hpb=49748181dd56ec97e7ba7c13e684a16abceb3cc0 diff --git a/tests/phpunit/includes/utils/BatchRowUpdateTest.php b/tests/phpunit/includes/utils/BatchRowUpdateTest.php index 6506d58e21..d80a61c4fb 100644 --- a/tests/phpunit/includes/utils/BatchRowUpdateTest.php +++ b/tests/phpunit/includes/utils/BatchRowUpdateTest.php @@ -4,6 +4,10 @@ * Tests for BatchRowUpdate and its components * * @group db + * + * @covers BatchRowUpdate + * @covers BatchRowIterator + * @covers BatchRowWriter */ class BatchRowUpdateTest extends MediaWikiTestCase { @@ -36,7 +40,7 @@ class BatchRowUpdateTest extends MediaWikiTestCase { $batchSize = 2; $reader = new BatchRowIterator( $db, 'some_table', 'id_field', $batchSize ); - $response = $this->genSelectResult( $batchSize, /*numRows*/ 5, function() { + $response = $this->genSelectResult( $batchSize, /*numRows*/ 5, function () { static $i = 0; return [ 'id_field' => ++$i ]; } ); @@ -171,7 +175,7 @@ class BatchRowUpdateTest extends MediaWikiTestCase { public function testReaderSelectConditionsMultiplePrimaryKeys( $message, $expectedSecondIteration, $primaryKeys, $batchSize = 3 ) { - $results = $this->genSelectResult( $batchSize, $batchSize * 3, function() { + $results = $this->genSelectResult( $batchSize, $batchSize * 3, function () { static $i = 0, $j = 100, $k = 1000; return [ 'id_field' => ++$i, 'foo' => ++$j, 'bar' => ++$k ]; } ); @@ -204,7 +208,7 @@ class BatchRowUpdateTest extends MediaWikiTestCase { ->will( $this->consecutivelyReturnFromSelect( $retvals ) ); $db->expects( $this->any() ) ->method( 'addQuotes' ) - ->will( $this->returnCallback( function( $value ) { + ->will( $this->returnCallback( function ( $value ) { return "'$value'"; // not real quoting: doesn't matter in test } ) );