3 use MediaWiki\Shell\Shell
;
6 * @covers \MediaWiki\Shell\Shell
9 class ShellTest
extends PHPUnit_Framework_TestCase
{
10 public function testIsDisabled() {
11 $this->assertInternalType( 'bool', Shell
::isDisabled() ); // sanity
15 * @dataProvider provideEscape
17 public function testEscape( $args, $expected ) {
18 if ( wfIsWindows() ) {
19 $this->markTestSkipped( 'This test requires a POSIX environment.' );
21 $this->assertSame( $expected, call_user_func_array( [ Shell
::class, 'escape' ], $args ) );
24 public function provideEscape() {
26 'simple' => [ [ 'true' ], "'true'" ],
27 'with args' => [ [ 'convert', '-font', 'font name' ], "'convert' '-font' 'font name'" ],
28 'array' => [ [ [ 'convert', '-font', 'font name' ] ], "'convert' '-font' 'font name'" ],
29 'skip nulls' => [ [ 'ls', null ], "'ls'" ],