mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-22 12:53:35 +00:00
086ce6550f
ParserOutput::getTOCHTML() is being deprecated, and all skins are now generating the TOC from the TOCData returned by ParserOutput::getTOCData(). The SHOW_TOC flag was introduced in core to determine if the TOC should be shown, but Vector-2022 *may* begin to use other heuristics to determine whether to show the TOC (T315862). We're conservatively going to process the TOC as long as there is TOC present to process. Bug: T328072 Change-Id: I38b439c6752157dbee9b09c9f5443a740dbaabf4
35 lines
742 B
PHP
35 lines
742 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Tests;
|
|
|
|
use ApiTestCase;
|
|
|
|
/**
|
|
* @group medium
|
|
* @group Database
|
|
*/
|
|
class ApiParseDiscussionToolsTest extends ApiTestCase {
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\DiscussionTools\CommentFormatter::addDiscussionTools
|
|
*/
|
|
public function testApiParseSections() {
|
|
$params = [
|
|
'action' => 'parse',
|
|
'title' => 'Talk:Test',
|
|
'uselang' => 'en',
|
|
'text' => "__FORCETOC__\n== foo ==\nbar ~~~~",
|
|
'pst' => 1,
|
|
'prop' => 'sections',
|
|
];
|
|
|
|
[ $result, ] = $this->doApiRequest( $params );
|
|
|
|
$this->assertSame(
|
|
'<span class="ext-discussiontools-init-sidebar-meta">1 comment</span>',
|
|
$result['parse']['sections'][0]['extensionData']['DiscussionTools-html-summary']
|
|
);
|
|
}
|
|
|
|
}
|