blob: 5348c854356493826be7cf6f32a25a3193973c52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<?php
class DeferredUpdatesTest extends MediaWikiTestCase {
public function testDoUpdates() {
$updates = array(
'1' => 'deferred update 1',
'2' => 'deferred update 2',
'3' => 'deferred update 3',
'2-1' => 'deferred update 1 within deferred update 2',
);
DeferredUpdates::addCallableUpdate(
function () use ( $updates ) {
echo $updates['1'];
}
);
DeferredUpdates::addCallableUpdate(
function () use ( $updates ) {
echo $updates['2'];
DeferredUpdates::addCallableUpdate(
function () use ( $updates ) {
echo $updates['2-1'];
}
);
}
);
DeferredUpdates::addCallableUpdate(
function () use ( $updates ) {
echo $updates[3];
}
);
$this->expectOutputString( implode( '', $updates ) );
DeferredUpdates::doUpdates();
}
}
|