4 * @group GlobalFunctions
5 * @covers ::wfShellExec
7 class WfShellExecTest
extends MediaWikiTestCase
{
8 public function testBug67870() {
9 $command = wfIsWindows()
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 ) );