diff options
author | Max Semenik <maxsem.wiki@gmail.com> | 2017-11-28 18:51:25 -0800 |
---|---|---|
committer | Max Semenik <maxsem.wiki@gmail.com> | 2017-11-29 12:38:35 -0800 |
commit | 36009e3ca78cb92914e72a59633ea219d601fc4f (patch) | |
tree | 6d2e3874ec3ed18e5956c3604fac569b3c9ea584 /tests/phpunit/includes/shell/ShellTest.php | |
parent | 70a602dde40e3694f8ef8b9c779a528c17a48f42 (diff) | |
download | mediawikicore-36009e3ca78cb92914e72a59633ea219d601fc4f.tar.gz mediawikicore-36009e3ca78cb92914e72a59633ea219d601fc4f.zip |
Shell: skip null parameters
Right now they're treated as empty strings, however
this doesn't allow skipping parameters in the middle like
$params = [
'foo',
$x ? '--bar' : null,
'--baz',
];
In some cases this matters, e.g. `ls` works while `ls ''` doesn't.
Also, fix spacing problems the new tests uncovered:
* Extra space when using params()
* Missing space when combining params() and unsafeParams()
Change-Id: Icb29d4c48ae7f92fb5635e3865346c98f47abb01
Diffstat (limited to 'tests/phpunit/includes/shell/ShellTest.php')
-rw-r--r-- | tests/phpunit/includes/shell/ShellTest.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/phpunit/includes/shell/ShellTest.php b/tests/phpunit/includes/shell/ShellTest.php index 1e91074fd400..7c96c3c85651 100644 --- a/tests/phpunit/includes/shell/ShellTest.php +++ b/tests/phpunit/includes/shell/ShellTest.php @@ -25,6 +25,7 @@ class ShellTest extends PHPUnit_Framework_TestCase { 'simple' => [ [ 'true' ], "'true'" ], 'with args' => [ [ 'convert', '-font', 'font name' ], "'convert' '-font' 'font name'" ], 'array' => [ [ [ 'convert', '-font', 'font name' ] ], "'convert' '-font' 'font name'" ], + 'skip nulls' => [ [ 'ls', null ], "'ls'" ], ]; } } |