assertSame() is guaranteed to never do any magic type conversion. This can be critical when accidentially comparing empty strings (a value PHP considers to be "falsy") to false, 0, 0.0, null, and such. Change-Id: I2e2685c5992cae252f629a68ffe1a049f2e5ed1b
30 lines
483 B
PHP
30 lines
483 B
PHP
<?php
|
|
|
|
/**
|
|
* @covers Http
|
|
* @group Http
|
|
* @group small
|
|
*/
|
|
class HttpTest extends MediaWikiTestCase {
|
|
|
|
/**
|
|
* @covers Http::getProxy
|
|
*/
|
|
public function testGetProxy() {
|
|
$this->hideDeprecated( 'Http::getProxy' );
|
|
|
|
$this->setMwGlobals( 'wgHTTPProxy', false );
|
|
$this->assertSame(
|
|
'',
|
|
Http::getProxy(),
|
|
'default setting'
|
|
);
|
|
|
|
$this->setMwGlobals( 'wgHTTPProxy', 'proxy.domain.tld' );
|
|
$this->assertEquals(
|
|
'proxy.domain.tld',
|
|
Http::getProxy()
|
|
);
|
|
}
|
|
|
|
}
|