wiki.techinc.nl/tests/phpunit/includes/deferred/CdnCacheUpdateTest.php
Aaron Schulz 282c5fa9f3 Rename SquidUpdate => CdnCacheUpdate
Squid is not the only possible CDN

Change-Id: Ie2a2955847c5706e630322bbbab71c9d063b378f
2015-12-09 16:31:17 -08:00

25 lines
825 B
PHP

<?php
class CdnCacheUpdateTest extends MediaWikiTestCase {
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' );
$update1 = new CdnCacheUpdate( $urls1 );
DeferredUpdates::addUpdate( $update1 );
$urls2 = array();
$urls2[] = $title->getCanonicalURL( '?x=2' );
$urls2[] = $title->getCanonicalURL( '?x=3' );
$urls2[] = $title->getCanonicalURL( '?x=4' );
$update2 = new CdnCacheUpdate( $urls2 );
DeferredUpdates::addUpdate( $update2 );
$wrapper = TestingAccessWrapper::newFromObject( $update1 );
$this->assertEquals( array_merge( $urls1, $urls2 ), $wrapper->urls );
}
}