Support offsets in prefix searching
[mediawiki.git] / tests / phpunit / includes / deferred / DeferredUpdatesTest.php
blob5348c854356493826be7cf6f32a25a3193973c52
1 <?php
3 class DeferredUpdatesTest extends MediaWikiTestCase {
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',
12 DeferredUpdates::addCallableUpdate(
13 function () use ( $updates ) {
14 echo $updates['1'];
17 DeferredUpdates::addCallableUpdate(
18 function () use ( $updates ) {
19 echo $updates['2'];
20 DeferredUpdates::addCallableUpdate(
21 function () use ( $updates ) {
22 echo $updates['2-1'];
27 DeferredUpdates::addCallableUpdate(
28 function () use ( $updates ) {
29 echo $updates[3];
33 $this->expectOutputString( implode( '', $updates ) );
35 DeferredUpdates::doUpdates();