X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiMainTest.php;h=a5518a125249b1bcde6a4d36da2b97cd749d9393;hb=a88f1d6b58613cbfa5c24c97887197a41ce66908;hp=9cb84e23bc183a3f767432d7ebdfb552e039eb70;hpb=366f5d69c1fc144b554abeebca704321a4d8ac66;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index 9cb84e23bc..a5518a1252 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -490,7 +490,7 @@ class ApiMainTest extends ApiTestCase { * @param int $status Expected response status * @param array $options Array of options: * post => true Request is a POST - * cdn => true CDN is enabled ($wgUseSquid) + * cdn => true CDN is enabled ($wgUseCdn) */ public function testCheckConditionalRequestHeaders( $headers, $conditions, $status, $options = [] @@ -508,7 +508,7 @@ class ApiMainTest extends ApiTestCase { $priv->mInternalMode = false; if ( !empty( $options['cdn'] ) ) { - $this->setMwGlobals( 'wgUseSquid', true ); + $this->setMwGlobals( 'wgUseCdn', true ); } // Can't do this in TestSetup.php because Setup.php will override it @@ -531,7 +531,7 @@ class ApiMainTest extends ApiTestCase { } public static function provideCheckConditionalRequestHeaders() { - global $wgSquidMaxage; + global $wgCdnMaxAge; $now = time(); return [ @@ -614,15 +614,15 @@ class ApiMainTest extends ApiTestCase { [ [ 'If-Modified-Since' => 'a potato' ], [ 'last-modified' => wfTimestamp( TS_MW, $now - 1 ) ], 200 ], - // Anything before $wgSquidMaxage seconds ago should be considered + // Anything before $wgCdnMaxAge seconds ago should be considered // expired. 'If-Modified-Since with CDN post-expiry' => - [ [ 'If-Modified-Since' => wfTimestamp( TS_RFC2822, $now - $wgSquidMaxage * 2 ) ], - [ 'last-modified' => wfTimestamp( TS_MW, $now - $wgSquidMaxage * 3 ) ], + [ [ 'If-Modified-Since' => wfTimestamp( TS_RFC2822, $now - $wgCdnMaxAge * 2 ) ], + [ 'last-modified' => wfTimestamp( TS_MW, $now - $wgCdnMaxAge * 3 ) ], 200, [ 'cdn' => true ] ], 'If-Modified-Since with CDN pre-expiry' => - [ [ 'If-Modified-Since' => wfTimestamp( TS_RFC2822, $now - $wgSquidMaxage / 2 ) ], - [ 'last-modified' => wfTimestamp( TS_MW, $now - $wgSquidMaxage * 3 ) ], + [ [ 'If-Modified-Since' => wfTimestamp( TS_RFC2822, $now - $wgCdnMaxAge / 2 ) ], + [ 'last-modified' => wfTimestamp( TS_MW, $now - $wgCdnMaxAge * 3 ) ], 304, [ 'cdn' => true ] ], ]; }