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
17 lines
368 B
PHP
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 );
|
|
}
|
|
}
|