Merge "Send 500 http status code, instead of 200, for DBConnectionErrors"
[lhc/web/wiklou.git] / tests / phpunit / includes / deferred / CdnCacheUpdateTest.php
1 <?php
2
3 use Wikimedia\TestingAccessWrapper;
4
5 class CdnCacheUpdateTest extends MediaWikiTestCase {
6 public function testPurgeMergeWeb() {
7 $this->setMwGlobals( 'wgCommandLineMode', false );
8
9 $urls1 = [];
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 );
16
17 $urls2 = [];
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 );
23
24 $wrapper = TestingAccessWrapper::newFromObject( $update1 );
25 $this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
26 }
27 }