aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/shell/ShellTest.php
diff options
context:
space:
mode:
authordaniel <dkinzler@wikimedia.org>2023-07-05 14:38:04 +0200
committerTim Starling <tstarling@wikimedia.org>2023-07-25 01:35:59 +0000
commit420f22226656594f7af7a5c113ebf970ae6adcc8 (patch)
treec2d5bef3d876686841dff22de968fbe5edaf29a2 /tests/phpunit/includes/shell/ShellTest.php
parent073e1a6b0b6b71a40936c6189fe32d041838ea72 (diff)
downloadmediawikicore-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.php37
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' ],
],
];
}
+
}