wiki.techinc.nl/tests/phpunit/includes/deferred/CdnCacheUpdateTest.php
Kunal Mehta 6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00

25 lines
815 B
PHP

<?php
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 );
}
}