<?php
use MediaWiki\Shell\Command;
+use Wikimedia\TestingAccessWrapper;
/**
+ * @covers \MediaWiki\Shell\Command
* @group Shell
*/
class CommandTest extends PHPUnit_Framework_TestCase {
$this->assertRegExp( '/^.+no-such-file.*$/m', $result->getStderr() );
}
+ /**
+ * Test that null values are skipped by params() and unsafeParams()
+ */
+ public function testNullsAreSkipped() {
+ $command = TestingAccessWrapper::newFromObject( new Command );
+ $command->params( 'echo', 'a', null, 'b' );
+ $command->unsafeParams( 'c', null, 'd' );
+ $this->assertEquals( "'echo' 'a' 'b' c d", $command->command );
+ }
+
public function testT69870() {
$commandLine = wfIsWindows()
// 333 = 331 + CRLF