2017-10-12 20:19:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
2023-11-21 21:08:14 +00:00
|
|
|
use MediaWiki\Deferred\TransactionRoundDefiningUpdate;
|
|
|
|
|
|
2017-10-12 20:19:56 +00:00
|
|
|
/**
|
2024-01-27 00:11:07 +00:00
|
|
|
* @covers \MediaWiki\Deferred\TransactionRoundDefiningUpdate
|
2017-10-12 20:19:56 +00:00
|
|
|
*/
|
2019-07-07 23:28:25 +00:00
|
|
|
class TransactionRoundDefiningUpdateTest extends MediaWikiUnitTestCase {
|
2017-12-29 23:22:37 +00:00
|
|
|
|
2017-10-12 20:19:56 +00:00
|
|
|
public function testDoUpdate() {
|
|
|
|
|
$ran = 0;
|
2021-02-07 13:10:36 +00:00
|
|
|
$update = new TransactionRoundDefiningUpdate( static function () use ( &$ran ) {
|
2017-10-12 20:19:56 +00:00
|
|
|
$ran++;
|
|
|
|
|
} );
|
|
|
|
|
$this->assertSame( 0, $ran );
|
|
|
|
|
$update->doUpdate();
|
|
|
|
|
$this->assertSame( 1, $ran );
|
|
|
|
|
}
|
|
|
|
|
}
|