MediaWiki
REL1_19
|
00001 <?php 00002 00003 class EditPageTest extends MediaWikiTestCase { 00004 00008 function testExtractSectionTitle( $section, $title ) { 00009 $extracted = EditPage::extractSectionTitle( $section ); 00010 $this->assertEquals( $title, $extracted ); 00011 } 00012 00013 function dataExtractSectionTitle() { 00014 return array( 00015 array( 00016 "== Test ==\n\nJust a test section.", 00017 "Test" 00018 ), 00019 array( 00020 "An initial section, no header.", 00021 false 00022 ), 00023 array( 00024 "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf", 00025 false 00026 ), 00027 array( 00028 "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo", 00029 "Section" 00030 ) 00031 ); 00032 } 00033 }