| 1 |
<?php |
| 2 |
|
| 3 |
use MediaWiki\MainConfigNames; |
| 4 |
use MediaWiki\Specials\SpecialUpload; |
| 5 |
|
| 6 |
class SpecialUploadTest extends MediaWikiIntegrationTestCase { |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
public function testGetInitialPageText( $expected, $inputParams ) { |
| 12 |
$this->overrideConfigValue( MainConfigNames::LanguageCode, 'en' ); |
| 13 |
$result = SpecialUpload::getInitialPageText( ...$inputParams ); |
| 14 |
$this->assertEquals( $expected, $result ); |
| 15 |
} |
| 16 |
|
| 17 |
public static function provideGetInitialPageText() { |
| 18 |
return [ |
| 19 |
[ |
| 20 |
'expect' => "== Summary ==\nthis is a test\n", |
| 21 |
'params' => [ |
| 22 |
'this is a test' |
| 23 |
], |
| 24 |
], |
| 25 |
[ |
| 26 |
'expect' => "== Summary ==\nthis is a test\n", |
| 27 |
'params' => [ |
| 28 |
"== Summary ==\nthis is a test", |
| 29 |
], |
| 30 |
], |
| 31 |
]; |
| 32 |
} |
| 33 |
} |