mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
28 lines
970 B
PHP
28 lines
970 B
PHP
<?php
|
|
/**
|
|
* @group bovender
|
|
* @group Database
|
|
*/
|
|
class ParseOnEditTest extends LinkTitles\TestCase {
|
|
|
|
public function testParseOnEdit() {
|
|
$this->setMwGlobals( [
|
|
'wgLinkTitlesParseOnEdit' => true,
|
|
'wgLinkTitlesParseOnRender' => false
|
|
] );
|
|
$pageId = $this->insertPage( 'test page', 'This page should link to the link target but not to test page' )['id'];
|
|
$page = WikiPage::newFromId( $pageId );
|
|
$this->assertSame( 'This page should link to the [[link target]] but not to test page', self::getPageText( $page ) );
|
|
}
|
|
|
|
public function testDoNotParseOnEdit() {
|
|
$this->setMwGlobals( [
|
|
'wgLinkTitlesParseOnEdit' => false,
|
|
'wgLinkTitlesParseOnRender' => false
|
|
] );
|
|
$pageId = $this->insertPage( 'test page', 'This page should not link to the link target' )['id'];
|
|
$page = WikiPage::newFromId( $pageId );
|
|
$this->assertSame( 'This page should not link to the link target', self::getPageText( $page ) );
|
|
}
|
|
}
|