setTitle( null ); $partial = new BodyContent( new SkinCitizen( [ 'name' => 'SkinCitizen' ] ) ); $this->assertEquals( '', $partial->decorateBodyContent( '' ) ); } /** * @covers \MediaWiki\Skins\Citizen\Partials\BodyContent * @return void * @throws MWException */ public function testDecorateBodyContentCollapseNotEnabled() { $this->overrideConfigValues( [ 'CitizenEnableCollapsibleSections' => false, ] ); RequestContext::resetMain(); RequestContext::getMain()->setTitle( null ); $partial = new BodyContent( new SkinCitizen( [ 'name' => 'SkinCitizen' ] ) ); $this->assertEquals( '', $partial->decorateBodyContent( '' ) ); } /** * @covers \MediaWiki\Skins\Citizen\Partials\BodyContent * @return void * @throws MWException */ public function testDecorateBodyContentCollapseEnabledContentPage() { $this->overrideConfigValues( [ 'CitizenEnableCollapsibleSections' => true, ] ); $title = Title::newFromText( 'BodyContent' ); RequestContext::resetMain(); RequestContext::getMain()->setTitle( $title ); $partial = new BodyContent( new SkinCitizen( [ 'name' => 'SkinCitizen' ] ) ); $html = <<

Sidebar

HTML; AtEase::suppressWarnings(); $this->assertStringContainsString( 'section-indicator', $partial->decorateBodyContent( $html ) ); AtEase::restoreWarnings(); } }