r97963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97962‎ | r97963 | r97964 >
Date:22:17, 23 September 2011
Author:brion
Status:ok
Tags:
Comment:
Followup r97954: fix unit tests for wfShellMaintenanceCmd() to work on Unix as well as Windows
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php
@@ -909,6 +909,10 @@
910910 * @dataProvider provideWfShellMaintenanceCmdList
911911 */
912912 function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) {
 913+ if( wfIsWindows() ) {
 914+ // Approximation that's good enough for our purposes just now
 915+ $expected = str_replace( "'", '"', $expected );
 916+ }
913917 $actual = wfShellMaintenanceCmd( $script, $parameters, $options );
914918 $this->assertEquals( $expected, $actual, $description );
915919 }
@@ -917,16 +921,16 @@
918922 global $wgPhpCli;
919923 return array(
920924 array( 'eval.php', array( '--help', '--test' ), array(),
921 - "\"$wgPhpCli\" \"eval.php\" \"--help\" \"--test\"",
 925+ "'$wgPhpCli' 'eval.php' '--help' '--test'",
922926 "Called eval.php --help --test" ),
923927 array( 'eval.php', array( '--help', '--test space' ), array('php' => 'php5'),
924 - "\"php5\" \"eval.php\" \"--help\" \"--test space\"",
 928+ "'php5' 'eval.php' '--help' '--test space'",
925929 "Called eval.php --help --test with php option" ),
926930 array( 'eval.php', array( '--help', '--test', 'X' ), array('wrapper' => 'MWScript.php'),
927 - "\"$wgPhpCli\" \"MWScript.php\" \"eval.php\" \"--help\" \"--test\" \"X\"",
 931+ "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'",
928932 "Called eval.php --help --test with wrapper option" ),
929933 array( 'eval.php', array( '--help', '--test', 'y' ), array('php' => 'php5', 'wrapper' => 'MWScript.php'),
930 - "\"php5\" \"MWScript.php\" \"eval.php\" \"--help\" \"--test\" \"y\"",
 934+ "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'",
931935 "Called eval.php --help --test with wrapper and php option" ),
932936 );
933937 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97954Added wfShellMaintenanceCmd() for Het Deploy supportaaron20:42, 23 September 2011

Status & tagging log