4 * @covers MWCallableUpdate
6 class MWCallableUpdateTest
extends PHPUnit_Framework_TestCase
{
8 public function testDoUpdate() {
10 $update = new MWCallableUpdate( function () use ( &$ran ) {
13 $this->assertSame( 0, $ran );
15 $this->assertSame( 1, $ran );
18 public function testCancel() {
19 // Prepare update and DB
20 $db = new DatabaseTestHelper( __METHOD__
);
21 $db->begin( __METHOD__
);
23 $update = new MWCallableUpdate( function () use ( &$ran ) {
28 $db->rollback( __METHOD__
);
30 // Ensure it was cancelled
32 $this->assertSame( 0, $ran );