X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Futils%2FBatchRowUpdateTest.php;h=017e97d35767b0db5f9bd0ed2ab76b99f879cea2;hb=be42e09aa866d7def54ead06c91d5dc9c8210ce5;hp=cb1b3d2af6b7da5fe9ad4dc152cfa0e92061b677;hpb=ea60bd7c46f2ccc866829f06919ad87e5ca9de53;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/utils/BatchRowUpdateTest.php b/tests/phpunit/includes/utils/BatchRowUpdateTest.php index cb1b3d2af6..017e97d357 100644 --- a/tests/phpunit/includes/utils/BatchRowUpdateTest.php +++ b/tests/phpunit/includes/utils/BatchRowUpdateTest.php @@ -36,7 +36,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 +171,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 +204,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 } ) ); @@ -237,7 +237,7 @@ class BatchRowUpdateTest extends MediaWikiTestCase { protected function mockDb() { // @TODO: mock from Database // FIXME: the constructor normally sets mAtomicLevels and mSrvCache - $databaseMysql = $this->getMockBuilder( 'DatabaseMysql' ) + $databaseMysql = $this->getMockBuilder( 'DatabaseMysqli' ) ->disableOriginalConstructor() ->getMock(); $databaseMysql->expects( $this->any() )