wiki.techinc.nl/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php
Timo Tijhof 6b2f8639b6 deferred: Introduce TransactionRoundDefiningUpdate
This allows scheduling of updates that need to start their own
transaction round. Specifically for cases where the ability to
commit early is not enough (which is already possible via LBFactory
getEmptyTransactionTicket and commitAndWaitForReplication).

Change-Id: I0910587b61c8ddf825f91e92c2f93582cc7ebd80
2017-10-13 21:24:11 +00:00

17 lines
368 B
PHP

<?php
/**
* @covers TransactionRoundDefiningUpdate
*/
class TransactionRoundDefiningUpdateTest extends PHPUnit_Framework_TestCase {
public function testDoUpdate() {
$ran = 0;
$update = new TransactionRoundDefiningUpdate( function () use ( &$ran ) {
$ran++;
} );
$this->assertSame( 0, $ran );
$update->doUpdate();
$this->assertSame( 1, $ran );
}
}