mediawiki-extensions-Discus.../tests/phpunit/integration/ApiParseDiscussionToolsTest.php
thiemowmde 6af3876b86 Stop using setMwGlobals in tests
In favor of the more recent, less error prone overrideConfigValue(s).

Change-Id: Ie3aa275f5d670c19d3f69467ed0b9383405f1440
2024-07-09 12:40:34 +02:00

40 lines
920 B
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools\Tests;
use ExtensionRegistry;
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group medium
* @group Database
*/
class ApiParseDiscussionToolsTest extends ApiTestCase {
/**
* @covers \MediaWiki\Extension\DiscussionTools\CommentFormatter::addDiscussionTools
*/
public function testApiParseSections() {
if ( ExtensionRegistry::getInstance()->isLoaded( 'Liquid Threads' ) ) {
$this->overrideConfigValue( 'LqtTalkPages', false );
}
$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']
);
}
}