Merge "Export $wgMainPageIsDomainRoot in siteinfo API"

This commit is contained in:
jenkins-bot 2019-10-09 16:17:19 +00:00 committed by Gerrit Code Review
commit 85f022b7eb
2 changed files with 3 additions and 0 deletions

View file

@ -132,6 +132,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
$data['mainpage'] = $mainPage->getPrefixedText();
$data['base'] = wfExpandUrl( $mainPage->getFullURL(), PROTO_CURRENT );
$data['sitename'] = $config->get( 'Sitename' );
$data['mainpageisdomainroot'] = (bool)$config->get( 'MainPageIsDomainRoot' );
// wgLogo can either be a relative or an absolute path
// make sure we always return an absolute path

View file

@ -30,6 +30,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase {
public function testGeneral() {
$this->setMwGlobals( [
'wgAllowExternalImagesFrom' => '//localhost/',
'wgMainPageIsDomainRoot' => true,
] );
$data = $this->doQuery();
@ -37,6 +38,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase {
$this->assertSame( Title::newMainPage()->getPrefixedText(), $data['mainpage'] );
$this->assertSame( PHP_VERSION, $data['phpversion'] );
$this->assertSame( [ '//localhost/' ], $data['externalimages'] );
$this->assertTrue( $data['mainpageisdomainroot'] );
}
public function testLinkPrefixCharset() {