Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[mediawiki.git] / tests / phpunit / includes / GlobalFunctions / wfShellExecTest.php
blobfcd26f541f33a9184bf9443294878eae5ce8e1d8
1 <?php
3 /**
4 * @group GlobalFunctions
5 * @covers ::wfShellExec
6 */
7 class WfShellExecTest extends MediaWikiTestCase {
8 public function testBug67870() {
9 $command = wfIsWindows()
10 // 333 = 331 + CRLF
11 ? ( 'for /l %i in (1, 1, 1001) do @echo ' . str_repeat( '*', 331 ) )
12 : 'printf "%-333333s" "*"';
14 // Test several times because it involves a race condition that may randomly succeed or fail
15 for ( $i = 0; $i < 10; $i++ ) {
16 $output = wfShellExec( $command );
17 $this->assertEquals( 333333, strlen( $output ) );