3 use MediaWiki\Shell\Shell
;
8 class ShellTest
extends PHPUnit_Framework_TestCase
{
9 public function testIsDisabled() {
10 $this->assertInternalType( 'bool', Shell
::isDisabled() ); // sanity
14 * @dataProvider provideEscape
16 public function testEscape( $args, $expected ) {
17 if ( wfIsWindows() ) {
18 $this->markTestSkipped( 'This test requires a POSIX environment.' );
20 $this->assertSame( $expected, call_user_func_array( [ Shell
::class, 'escape' ], $args ) );
23 public function provideEscape() {
25 'simple' => [ [ 'true' ], "'true'" ],
26 'with args' => [ [ 'convert', '-font', 'font name' ], "'convert' '-font' 'font name'" ],
27 'array' => [ [ [ 'convert', '-font', 'font name' ] ], "'convert' '-font' 'font name'" ],