MediaWiki  REL1_24
wfShellExecTest.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class WfShellExecTest extends MediaWikiTestCase {
00008     public function testBug67870() {
00009         $command = wfIsWindows()
00010             // 333 = 331 + CRLF
00011             ? ( 'for /l %i in (1, 1, 1001) do @echo ' . str_repeat( '*', 331 ) )
00012             : 'printf "%-333333s" "*"';
00013 
00014         // Test several times because it involves a race condition that may randomly succeed or fail
00015         for ( $i = 0; $i < 10; $i++ ) {
00016             $output = wfShellExec( $command );
00017             $this->assertEquals( 333333, strlen( $output ) );
00018         }
00019     }
00020 }