MediaWiki
REL1_31
wfShellExecTest.php
Go to the documentation of this file.
1
<?php
2
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" "*"'
;
13
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
) );
18
}
19
}
20
}
wfShellExec
wfShellExec( $cmd, &$retval=null, $environ=[], $limits=[], $options=[])
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported...
Definition
GlobalFunctions.php:2250
wfIsWindows
wfIsWindows()
Check if the operating system is Windows.
Definition
GlobalFunctions.php:2019
$command
$command
Definition
cdb.php:65
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
WfShellExecTest
GlobalFunctions wfShellExec.
Definition
wfShellExecTest.php:7
WfShellExecTest\testBug67870
testBug67870()
Definition
wfShellExecTest.php:8
$output
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
Definition
hooks.txt:2255
tests
phpunit
includes
GlobalFunctions
wfShellExecTest.php
Generated on Mon Nov 25 2024 15:36:23 for MediaWiki by
1.10.0