MediaWiki  REL1_20
EditPageTest.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class EditPageTest extends MediaWikiTestCase {
00007 
00011         function testExtractSectionTitle( $section, $title ) {
00012                 $extracted = EditPage::extractSectionTitle( $section );
00013                 $this->assertEquals( $title, $extracted );
00014         }
00015 
00016         function dataExtractSectionTitle() {
00017                 return array(
00018                         array(
00019                                 "== Test ==\n\nJust a test section.",
00020                                 "Test"
00021                         ),
00022                         array(
00023                                 "An initial section, no header.",
00024                                 false
00025                         ),
00026                         array(
00027                                 "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf",
00028                                 false
00029                         ),
00030                         array(
00031                                 "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo",
00032                                 "Section"
00033                         ),
00034                         array(
00035                                 "== Section== \t\r\n followed by whitespace (bug 35051)",
00036                                 'Section',
00037                         ),
00038                 );
00039         }
00040 }