Merge "Update docs/hooks.txt for ShowSearchHitTitle"
[mediawiki.git] / tests / phpunit / includes / deferred / CdnCacheUpdateTest.php
blobb96ec08551b5b99bd13dab5f96dbc3256d2e1799
1 <?php
3 class CdnCacheUpdateTest extends MediaWikiTestCase {
4 public function testPurgeMergeWeb() {
5 $this->setMwGlobals( 'wgCommandLineMode', false );
7 $urls1 = [];
8 $title = Title::newMainPage();
9 $urls1[] = $title->getCanonicalURL( '?x=1' );
10 $urls1[] = $title->getCanonicalURL( '?x=2' );
11 $urls1[] = $title->getCanonicalURL( '?x=3' );
12 $update1 = new CdnCacheUpdate( $urls1 );
13 DeferredUpdates::addUpdate( $update1 );
15 $urls2 = [];
16 $urls2[] = $title->getCanonicalURL( '?x=2' );
17 $urls2[] = $title->getCanonicalURL( '?x=3' );
18 $urls2[] = $title->getCanonicalURL( '?x=4' );
19 $update2 = new CdnCacheUpdate( $urls2 );
20 DeferredUpdates::addUpdate( $update2 );
22 $wrapper = TestingAccessWrapper::newFromObject( $update1 );
23 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );