diff options
author | daniel <dkinzler@wikimedia.org> | 2023-07-05 14:38:04 +0200 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2023-07-25 01:35:59 +0000 |
commit | 420f22226656594f7af7a5c113ebf970ae6adcc8 (patch) | |
tree | c2d5bef3d876686841dff22de968fbe5edaf29a2 /tests/phpunit/includes/shell/ShellTest.php | |
parent | 073e1a6b0b6b71a40936c6189fe32d041838ea72 (diff) | |
download | mediawikicore-420f22226656594f7af7a5c113ebf970ae6adcc8.tar.gz mediawikicore-420f22226656594f7af7a5c113ebf970ae6adcc8.zip |
Make Shell::makeScriptCommand use run.php
This makes makeScriptCommand wrap all callers in run.php
Change-Id: If041beb6d4b6b3555e0c200a3d5088a94c198349
Diffstat (limited to 'tests/phpunit/includes/shell/ShellTest.php')
-rw-r--r-- | tests/phpunit/includes/shell/ShellTest.php | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/phpunit/includes/shell/ShellTest.php b/tests/phpunit/includes/shell/ShellTest.php index 67128ebec35c..8c2c29ffb5b4 100644 --- a/tests/phpunit/includes/shell/ShellTest.php +++ b/tests/phpunit/includes/shell/ShellTest.php @@ -76,16 +76,18 @@ class ShellTest extends MediaWikiIntegrationTestCase { public static function provideMakeScriptCommand() { global $wgPhpCli; + $IP = MW_INSTALL_PATH; + return [ - [ - "'$wgPhpCli' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe", - '"' . $wgPhpCli . '" "maintenance/foobar.php" "bar\'\\"baz" "safe" unsafe', - 'maintenance/foobar.php', + 'no option' => [ + "'$wgPhpCli' '$IP/maintenance/run.php' '$IP/maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe", + "\"$wgPhpCli\" \"$IP/maintenance/run.php\" \"$IP/maintenance/foobar.php\" \"bar'\\\"baz\" \"safe\" unsafe", + "$IP/maintenance/foobar.php", [ 'bar\'"baz' ], ], - [ - "'$wgPhpCli' 'changed.php' '--wiki=somewiki' 'bar'\\''\"baz' 'safe' unsafe", - '"' . $wgPhpCli . '" "changed.php" "--wiki=somewiki" "bar\'\\"baz" "safe" unsafe', + 'hook' => [ + "'$wgPhpCli' '$IP/maintenance/run.php' 'changed.php' '--wiki=somewiki' 'bar'\\''\"baz' 'safe' unsafe", + "\"$wgPhpCli\" \"$IP/maintenance/run.php\" \"changed.php\" \"--wiki=somewiki\" \"bar'\\\"baz\" \"safe\" unsafe", 'maintenance/foobar.php', [ 'bar\'"baz' ], [], @@ -94,20 +96,21 @@ class ShellTest extends MediaWikiIntegrationTestCase { array_unshift( $parameters, '--wiki=somewiki' ); } ], - [ - "'/bin/perl' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe", - '"/bin/perl" "maintenance/foobar.php" "bar\'\\"baz" "safe" unsafe', - 'maintenance/foobar.php', - [ 'bar\'"baz' ], + 'php option' => [ + "'/bin/perl' '$IP/maintenance/run.php' 'maintenance/foobar.php' 'safe' unsafe", + "\"/bin/perl\" \"$IP/maintenance/run.php\" \"maintenance/foobar.php\" \"safe\" unsafe", + "maintenance/foobar.php", + [], [ 'php' => '/bin/perl' ], ], - [ - "'$wgPhpCli' 'foobinize' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe", - '"' . $wgPhpCli . '" "foobinize" "maintenance/foobar.php" "bar\'\\"baz" "safe" unsafe', - 'maintenance/foobar.php', - [ 'bar\'"baz' ], + 'wrapper option' => [ + "'$wgPhpCli' 'foobinize' 'maintenance/foobar.php' 'safe' unsafe", + "\"$wgPhpCli\" \"foobinize\" \"maintenance/foobar.php\" \"safe\" unsafe", + "maintenance/foobar.php", + [], [ 'wrapper' => 'foobinize' ], ], ]; } + } |