Merge "Support explicit 0 and 1 forms for plural in PHP"
[lhc/web/wiklou.git] / tests / phpunit / includes / EditPageTest.php
1 <?php
2
3 /**
4 * @group Editing
5 */
6 class EditPageTest extends MediaWikiTestCase {
7
8 /**
9 * @dataProvider dataExtractSectionTitle
10 */
11 function testExtractSectionTitle( $section, $title ) {
12 $extracted = EditPage::extractSectionTitle( $section );
13 $this->assertEquals( $title, $extracted );
14 }
15
16 function dataExtractSectionTitle() {
17 return array(
18 array(
19 "== Test ==\n\nJust a test section.",
20 "Test"
21 ),
22 array(
23 "An initial section, no header.",
24 false
25 ),
26 array(
27 "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf",
28 false
29 ),
30 array(
31 "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo",
32 "Section"
33 ),
34 array(
35 "== Section== \t\r\n followed by whitespace (bug 35051)",
36 'Section',
37 ),
38 );
39 }
40 }