Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks
[lhc/web/wiklou.git] / tests / phpunit / includes / deferred / DeferredUpdatesTest.php
1 <?php
2
3 class DeferredUpdatesTest extends MediaWikiTestCase {
4
5 public function testDoUpdates() {
6 $updates = array(
7 '1' => 'deferred update 1',
8 '2' => 'deferred update 2',
9 '3' => 'deferred update 3',
10 '2-1' => 'deferred update 1 within deferred update 2',
11 );
12 DeferredUpdates::addCallableUpdate(
13 function () use ( $updates ) {
14 echo $updates['1'];
15 }
16 );
17 DeferredUpdates::addCallableUpdate(
18 function () use ( $updates ) {
19 echo $updates['2'];
20 DeferredUpdates::addCallableUpdate(
21 function () use ( $updates ) {
22 echo $updates['2-1'];
23 }
24 );
25 }
26 );
27 DeferredUpdates::addCallableUpdate(
28 function () use ( $updates ) {
29 echo $updates[3];
30 }
31 );
32
33 $this->expectOutputString( implode( '', $updates ) );
34
35 DeferredUpdates::doUpdates();
36 }
37
38 }