Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6103266
WfEscapeShellArgTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
868 B
Referenced Files
None
Subscribers
None
WfEscapeShellArgTest.php
View Options
<?php
/**
* @group GlobalFunctions
* @covers ::wfEscapeShellArg
*/
class
WfEscapeShellArgTest
extends
MediaWikiUnitTestCase
{
public
function
testSingleInput
()
{
if
(
wfIsWindows
()
)
{
$expected
=
'"blah"'
;
}
else
{
$expected
=
"'blah'"
;
}
$actual
=
wfEscapeShellArg
(
'blah'
);
$this
->
assertEquals
(
$expected
,
$actual
);
}
public
function
testMultipleArgs
()
{
if
(
wfIsWindows
()
)
{
$expected
=
'"foo" "bar" "baz"'
;
}
else
{
$expected
=
"'foo' 'bar' 'baz'"
;
}
$actual
=
wfEscapeShellArg
(
'foo'
,
'bar'
,
'baz'
);
$this
->
assertEquals
(
$expected
,
$actual
);
}
public
function
testMultipleArgsAsArray
()
{
if
(
wfIsWindows
()
)
{
$expected
=
'"foo" "bar" "baz"'
;
}
else
{
$expected
=
"'foo' 'bar' 'baz'"
;
}
$actual
=
wfEscapeShellArg
(
[
'foo'
,
'bar'
,
'baz'
]
);
$this
->
assertEquals
(
$expected
,
$actual
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 6 2026, 11:05 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3b/2d/214301bfff71f728b8ffcbf970e7
Default Alt Text
WfEscapeShellArgTest.php (868 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment