Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / tests / phpunit / includes / deferred / CdnCacheUpdateTest.php
1 <?php
2
3 use Wikimedia\TestingAccessWrapper;
4
5 class CdnCacheUpdateTest extends MediaWikiTestCase {
6
7 /**
8 * @covers CdnCacheUpdate::merge
9 */
10 public function testPurgeMergeWeb() {
11 $this->setMwGlobals( 'wgCommandLineMode', false );
12
13 $urls1 = [];
14 $title = Title::newMainPage();
15 $urls1[] = $title->getCanonicalURL( '?x=1' );
16 $urls1[] = $title->getCanonicalURL( '?x=2' );
17 $urls1[] = $title->getCanonicalURL( '?x=3' );
18 $update1 = new CdnCacheUpdate( $urls1 );
19 DeferredUpdates::addUpdate( $update1 );
20
21 $urls2 = [];
22 $urls2[] = $title->getCanonicalURL( '?x=2' );
23 $urls2[] = $title->getCanonicalURL( '?x=3' );
24 $urls2[] = $title->getCanonicalURL( '?x=4' );
25 $update2 = new CdnCacheUpdate( $urls2 );
26 DeferredUpdates::addUpdate( $update2 );
27
28 $wrapper = TestingAccessWrapper::newFromObject( $update1 );
29 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
30 }
31 }