!! article Main Page !! text [[Category:Test pages]] !! endarticle !! article Test page !! text [[Category:Test pages]] !! endarticle !! article Other page !! text [[Category:Test pages]] !! endarticle !! article Category:Test pages !! text [[Category:Test categories]] !! endarticle !! article Test default sort key !! text {{#phptag: echo WPage::$defaultSortKey === false ? 'false' : 'true'; }} {{#phptag: WPage::$defaultSortKey = 'Sort key page'; }} [[Category:Test pages]] {{#phptag: echo WPage::$defaultSortKey === false ? 'false' : 'true'; }} !! endarticle !! test WStats::USERS !! input echo WStats::USERS > 0 ? 'true' : 'false'; !! result

true

!! end !! test WStats::PAGES !! input echo WStats::PAGES > 0 ? 'true' : 'false'; !! result

true

!! end !! test WPage::TITLE !! options title=[[User:Ævar Arnfjörð Bjarmason]] !! input {{#phptag: WPage::TITLE }} !! result

User:Ævar Arnfjörð Bjarmason

!! end !! test WPage::TITLE->name !! options title=[[User:Ævar Arnfjörð Bjarmason]] !! input {{#phptag: WPage::TITLE->name }} !! result

Ævar Arnfjörð Bjarmason

!! end !! test WPage::TITLE->talkNsText !! input {{#phptag: WPage::TITLE->talkNsText }} !! result

Talk

!! end !! test WCategory->pageCount Test pages !! options disabled MediaWiki core uses a dummy parser when inserting articles. T163733 !! input $c = new WCategory( 'Test pages' ); echo $c->pageCount; !! result

4

!! end !! test WCategory->subcatCount !! options disabled MediaWiki core uses a dummy parser when inserting articles. T163733 !! input $c = new WCategory( 'Test categories' ); echo $c->subcatCount; !! result

1

!! end !! test Test default sort key !! input {{:Test default sort key}} !! result

false true

!! end !! test WPage::addCategory foo !! input WPage::addCategory( 'Foo' ); !! result !! end !! test WPage::addCategory foo bar !! input WPage::addCategory( ['foo', 'bar'] ); !! result !! end !! test WPage::addCategory WCategory bar !! input WPage::addCategory( new WCategory( 'bar' ) ); !! result !! end !! article WTitle ID !! text if ( WTitle::ID > 0 ) { echo 'pass WTitle::ID', "\n\n"; } $t = new WTitle('Test pages', NS_CATEGORY); if ( $t->ID > 0 && $t->ID != WTitle::ID ) { echo 'pass WTitle->ID', "\n\n"; } !! endarticle !! test Test WTitle ID !! input $t1 = new WTitle( 'Test pages', NS_CATEGORY ); $t2 = new WTitle( 'Category:Test pages' ); if ( $t1->ID > 0 ) { echo 'pass1, it is ok', "\n\n"; } if ( $t1->ID == $t2->ID ) { echo 'pass2, it is ok', "\n\n"; } !! result

pass1, it is ok

pass2, it is ok


!! end !! test Test W::MAIN_PAGE !! input echo W::MAIN_PAGE; !! result

Main Page

!! end