3 use Wikimedia\TestingAccessWrapper
;
5 class CdnCacheUpdateTest
extends MediaWikiTestCase
{
6 public function testPurgeMergeWeb() {
7 $this->setMwGlobals( 'wgCommandLineMode', false );
10 $title = Title
::newMainPage();
11 $urls1[] = $title->getCanonicalURL( '?x=1' );
12 $urls1[] = $title->getCanonicalURL( '?x=2' );
13 $urls1[] = $title->getCanonicalURL( '?x=3' );
14 $update1 = new CdnCacheUpdate( $urls1 );
15 DeferredUpdates
::addUpdate( $update1 );
18 $urls2[] = $title->getCanonicalURL( '?x=2' );
19 $urls2[] = $title->getCanonicalURL( '?x=3' );
20 $urls2[] = $title->getCanonicalURL( '?x=4' );
21 $update2 = new CdnCacheUpdate( $urls2 );
22 DeferredUpdates
::addUpdate( $update2 );
24 $wrapper = TestingAccessWrapper
::newFromObject( $update1 );
25 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls
);