wiki.techinc.nl/tests/phpunit/includes/GlobalFunctions/wfEscapeShellArgTest.php
umherirrender 9683aca644 Fix class name of WfEscapeShellArgTest
All other global function test also begin with a upper case letter

Change-Id: Icbaa701983a6f9b57e1ecaa705ebeacaada90cd6
2015-10-07 20:24:59 +02:00

43 lines
869 B
PHP

<?php
/**
* @group GlobalFunctions
* @covers ::wfEscapeShellArg
*/
class WfEscapeShellArgTest extends MediaWikiTestCase {
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( array( 'foo', 'bar', 'baz' ) );
$this->assertEquals( $expected, $actual );
}
}