2015-11-30 23:26:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
2015-12-09 18:05:59 +00:00
|
|
|
class CdnCacheUpdateTest extends MediaWikiTestCase {
|
2015-11-30 23:26:45 +00:00
|
|
|
public function testPurgeMergeWeb() {
|
|
|
|
|
$this->setMwGlobals( 'wgCommandLineMode', false );
|
|
|
|
|
|
|
|
|
|
$urls1 = array();
|
|
|
|
|
$title = Title::newMainPage();
|
|
|
|
|
$urls1[] = $title->getCanonicalURL( '?x=1' );
|
|
|
|
|
$urls1[] = $title->getCanonicalURL( '?x=2' );
|
|
|
|
|
$urls1[] = $title->getCanonicalURL( '?x=3' );
|
2015-12-09 18:05:59 +00:00
|
|
|
$update1 = new CdnCacheUpdate( $urls1 );
|
2015-11-30 23:26:45 +00:00
|
|
|
DeferredUpdates::addUpdate( $update1 );
|
|
|
|
|
|
|
|
|
|
$urls2 = array();
|
|
|
|
|
$urls2[] = $title->getCanonicalURL( '?x=2' );
|
|
|
|
|
$urls2[] = $title->getCanonicalURL( '?x=3' );
|
|
|
|
|
$urls2[] = $title->getCanonicalURL( '?x=4' );
|
2015-12-09 18:05:59 +00:00
|
|
|
$update2 = new CdnCacheUpdate( $urls2 );
|
2015-11-30 23:26:45 +00:00
|
|
|
DeferredUpdates::addUpdate( $update2 );
|
|
|
|
|
|
|
|
|
|
$wrapper = TestingAccessWrapper::newFromObject( $update1 );
|
|
|
|
|
$this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
|
|
|
|
|
}
|
|
|
|
|
}
|