Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / tests / phpunit / includes / GlobalFunctions / wfShellExecTest.php
1 <?php
2
3 /**
4 * @group GlobalFunctions
5 * @covers ::wfShellExec
6 */
7 class WfShellExecTest extends MediaWikiTestCase {
8 public function testT69870() {
9 if ( wfIsWindows() ) {
10 // T209159: Anonymous pipe under Windows does not support asynchronous read and write,
11 // and the default buffer is too small (~4K), it is easy to be blocked.
12 $this->markTestSkipped(
13 'T209159: Anonymous pipe under Windows cannot withstand such a large amount of data'
14 );
15 }
16
17 // Test several times because it involves a race condition that may randomly succeed or fail
18 for ( $i = 0; $i < 10; $i++ ) {
19 $output = wfShellExec( 'printf "%-333333s" "*"' );
20 $this->assertEquals( 333333, strlen( $output ) );
21 }
22 }
23 }