mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Test Targets class.
This commit is contained in:
@ -10,9 +10,9 @@ class ParseOnEditTest extends LinkTitles\TestCase {
|
|||||||
'wgLinkTitlesParseOnEdit' => true,
|
'wgLinkTitlesParseOnEdit' => true,
|
||||||
'wgLinkTitlesParseOnRender' => false
|
'wgLinkTitlesParseOnRender' => false
|
||||||
] );
|
] );
|
||||||
$pageId = $this->insertPage( 'test page', 'This page should link to the link target' )['id'];
|
$pageId = $this->insertPage( 'test page', 'This page should link to the link target but not to test page' )['id'];
|
||||||
$page = WikiPage::newFromId( $pageId );
|
$page = WikiPage::newFromId( $pageId );
|
||||||
$this->assertSame( 'This page should link to the [[link target]]', self::getPageText( $page ) );
|
$this->assertSame( 'This page should link to the [[link target]] but not to test page', self::getPageText( $page ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDoNotParseOnEdit() {
|
public function testDoNotParseOnEdit() {
|
||||||
|
@ -17,10 +17,10 @@ class TargetsTest extends LinkTitles\TestCase {
|
|||||||
|
|
||||||
// Count number of articles: Inspired by updateArticleCount.php maintenance
|
// Count number of articles: Inspired by updateArticleCount.php maintenance
|
||||||
// script: https://doc.wikimedia.org/mediawiki-core/master/php/updateArticleCount_8php_source.html
|
// script: https://doc.wikimedia.org/mediawiki-core/master/php/updateArticleCount_8php_source.html
|
||||||
$dbr = $this->getDB( DB_MASTER );
|
$dbr = wfGetDB( DB_SLAVE );
|
||||||
$counter = new SiteStatsInit( $dbr );
|
$counter = new SiteStatsInit( $dbr );
|
||||||
$count = $counter->articles();
|
$count = $counter->pages();
|
||||||
|
|
||||||
$this->assertSame( $targets->queryResult->numRows(), $count );
|
$this->assertEquals( $targets->queryResult->numRows(), $count );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user