wiki.techinc.nl/tests/phpunit/includes/deferred/CdnCacheUpdateTest.php
Gergő Tisza 525bfbc8df Switch to librarized version of TestingAccessWrapper
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).

See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.

The core version of the class is kept around for a while to avoid
circular dependency problems.

Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
2017-04-20 14:15:57 +00:00

27 lines
852 B
PHP

<?php
use Wikimedia\TestingAccessWrapper;
class CdnCacheUpdateTest extends MediaWikiTestCase {
public function testPurgeMergeWeb() {
$this->setMwGlobals( 'wgCommandLineMode', false );
$urls1 = [];
$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 = [];
$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 );
}
}