14 $title = Title::newMainPage();
15 $urls1[] =
$title->getCanonicalURL(
'?x=1' );
16 $urls1[] =
$title->getCanonicalURL(
'?x=2' );
17 $urls1[] =
$title->getCanonicalURL(
'?x=3' );
19 DeferredUpdates::addUpdate( $update1 );
22 $urls2[] =
$title->getCanonicalURL(
'?x=2' );
23 $urls2[] =
$title->getCanonicalURL(
'?x=3' );
24 $urls2[] =
$title->getCanonicalURL(
'?x=4' );
26 DeferredUpdates::addUpdate( $update2 );
28 $wrapper = TestingAccessWrapper::newFromObject( $update1 );
29 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
32 DeferredUpdates::clearPendingUpdates();
33 DeferredUpdates::addCallableUpdate(
function ()
use ( $urls1, $urls2, &$update ) {
35 DeferredUpdates::addUpdate( $update );
37 DeferredUpdates::addUpdate(
40 DeferredUpdates::doUpdates();
42 $wrapper = TestingAccessWrapper::newFromObject( $update );
43 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
45 $this->assertEquals( DeferredUpdates::pendingUpdatesCount(), 0,
'PRESEND update run' );