mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-21 12:23:41 +00:00
3dc5e88842
Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I492ddae3c3e9f81d551ea8b348b7148893f4f590
40 lines
915 B
PHP
40 lines
915 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->setMwGlobals( 'wgLqtTalkPages', 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']
|
|
);
|
|
}
|
|
|
|
}
|